mirror of
https://github.com/aljazceru/cowrie.git
synced 2026-01-31 12:04:24 +01:00
only log tftp download when successful
This commit is contained in:
@@ -55,16 +55,6 @@ class command_tftp(HoneyPotCommand):
|
||||
time.strftime('%Y%m%d%H%M%S'),
|
||||
re.sub('[^A-Za-z0-9]', '_', self.file_to_get))
|
||||
|
||||
self.protocol.logDispatch(eventid='cowrie.session.file_download',
|
||||
format='Downloaded tftpFile to %(outfile)s',
|
||||
outfile=self.safeoutfile
|
||||
)
|
||||
|
||||
log.msg(eventid='cowrie.session.file_download',
|
||||
format='Downloaded tftpFile to %(outfile)s',
|
||||
outfile=self.safeoutfile
|
||||
)
|
||||
|
||||
try:
|
||||
tclient.download(self.file_to_get, self.safeoutfile, progresshook)
|
||||
self.file_to_get = self.fs.resolve_path(self.file_to_get, self.protocol.cwd)
|
||||
@@ -73,6 +63,16 @@ class command_tftp(HoneyPotCommand):
|
||||
f = self.fs.getfile(self.file_to_get)
|
||||
f[A_REALFILE] = self.safeoutfile
|
||||
|
||||
self.protocol.logDispatch(eventid='cowrie.session.file_download',
|
||||
format='Downloaded tftpFile to %(outfile)s',
|
||||
outfile=self.safeoutfile
|
||||
)
|
||||
|
||||
log.msg(eventid='cowrie.session.file_download',
|
||||
format='Downloaded tftpFile to %(outfile)s',
|
||||
outfile=self.safeoutfile
|
||||
)
|
||||
|
||||
except tftpy.TftpException, err:
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user