This commit is contained in:
Michel Oosterhof 2017-05-22 21:55:33 +04:00
commit 79f01fc6e2
1 changed files with 3 additions and 2 deletions

View File

@ -67,6 +67,9 @@ class command_tftp(HoneyPotCommand):
try:
tclient = tftpy.TftpClient(self.hostname, int(self.port))
tclient.download(self.file_to_get, self.safeoutfile, progresshook)
url = 'tftp://%s/%s' % (self.hostname, self.file_to_get.strip('/'))
self.file_to_get = self.fs.resolve_path(self.file_to_get, self.protocol.cwd)
if hasattr(tclient.context, 'metrics'):
self.fs.mkfile(self.file_to_get, 0, 0, tclient.context.metrics.bytes, 33188)
@ -95,8 +98,6 @@ class command_tftp(HoneyPotCommand):
os.remove(self.safeoutfile)
log.msg("Not storing duplicate content " + shasum)
url = 'tftp://%s/%s' % (self.hostname, self.file_to_get.strip('/'))
log.msg(eventid='cowrie.session.file_download',
format='Downloaded tftpFile (%(url)s) with SHA-256 %(shasum)s to %(outfile)s',
url=url,