use short 8 character uuid for log/ttylog

This commit is contained in:
Michel Oosterhof 2014-11-28 17:08:23 +00:00
parent eb558a816e
commit cb74f2f3ca
2 changed files with 3 additions and 6 deletions

View File

@ -238,17 +238,14 @@ class LoggingServerProtocol(insults.ServerProtocol):
transport.ttylog_file = '%s/tty/%s-%s.log' % \
(config().get('honeypot', 'log_path'),
time.strftime('%Y%m%d-%H%M%S'),
int(random.random() * 10000))
time.strftime('%Y%m%d-%H%M%S'), transport.transportId )
log.msg( 'Opening TTY log: %s' % transport.ttylog_file )
ttylog.ttylog_open(transport.ttylog_file, time.time())
transport.ttylog_open = True
transport.stdinlog_file = '%s/%s-%s-stdin.log' % \
(config().get('honeypot', 'download_path'),
time.strftime('%Y%m%d-%H%M%S'),
int(random.random() * 10000))
time.strftime('%Y%m%d-%H%M%S'), transport.transportId )
transport.stdinlog_open = False
insults.ServerProtocol.connectionMade(self)

View File

@ -162,7 +162,7 @@ class HoneyPotTransport(transport.SSHServerTransport):
def connectionMade(self):
self.logintime = time.time()
self.transportId = uuid.uuid4().hex
self.transportId = uuid.uuid4().hex[:8]
log.msg( 'New connection: %s:%s (%s:%s) [session: %d]' % \
(self.transport.getPeer().host, self.transport.getPeer().port,