Skip to content

Commit

Permalink
Fixed issue where absolute client paths caused saved filenames to inc…
Browse files Browse the repository at this point in the history
…lude path data
  • Loading branch information
Ryan O'Horo committed Mar 12, 2016
1 parent 6d34edb commit 842916d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions det.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def retrieve_file(self, jobid):
global files
fname = files[jobid]['filename']
filename = "%s.%s" % (fname.replace(
'/', ''), time.strftime("%Y-%m-%d.%H:%M:%S", time.gmtime()))
os.path.pathsep, ''), time.strftime("%Y-%m-%d.%H:%M:%S", time.gmtime()))
content = ''.join(str(v) for v in files[jobid]['data']).decode('hex')
f = open(filename, 'w')
f.write(content)
Expand Down Expand Up @@ -209,7 +209,7 @@ def run(self):

warning("[!] Registering packet for the file")
data = "%s|!|%s|!|REGISTER|!|%s" % (
self.jobid, self.file_to_send, self.checksum)
self.jobid, os.path.basename(self.file_to_send), self.checksum)
plugin_send_function(data)

time_to_sleep = randint(1, MAX_TIME_SLEEP)
Expand Down

0 comments on commit 842916d

Please sign in to comment.