mirror of https://github.com/cowrie/cowrie.git
harmonize artifact filenames. use transport + sessionid
This commit is contained in:
parent
d3e651c215
commit
91498f836c
|
@ -36,8 +36,12 @@ class HoneyPotCommand(object):
|
||||||
index = self.args.index(">")
|
index = self.args.index(">")
|
||||||
self.outfile = self.fs.resolve_path(str(self.args[(index + 1)]), self.protocol.cwd)
|
self.outfile = self.fs.resolve_path(str(self.args[(index + 1)]), self.protocol.cwd)
|
||||||
del self.args[index:]
|
del self.args[index:]
|
||||||
self.safeoutfile = '%s/%s_%s' % (self.protocol.cfg.get('honeypot', 'download_path'),
|
self.safeoutfile = '%s/%s-%s-%s-redir_%s' % (
|
||||||
time.strftime('%Y%m%d%H%M%S'), re.sub('[^A-Za-z0-9]', '_', "tmpecho"))
|
self.protocol.cfg.get('honeypot', 'download_path'),
|
||||||
|
time.strftime('%Y%m%d-%H%M%S'),
|
||||||
|
self.protocol.terminal.transport.session.conn.transport.transportId,
|
||||||
|
self.protocol.terminal.transport.session.id,
|
||||||
|
re.sub('[^A-Za-z0-9]', '_', self.outfile))
|
||||||
perm = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
|
perm = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
|
||||||
self.fs.mkfile(self.outfile, 0, 0, 0, stat.S_IFREG | perm)
|
self.fs.mkfile(self.outfile, 0, 0, 0, stat.S_IFREG | perm)
|
||||||
with open(self.safeoutfile, 'a'):
|
with open(self.safeoutfile, 'a'):
|
||||||
|
|
Loading…
Reference in New Issue