mirror of https://github.com/cowrie/cowrie.git
use short 8 character uuid for log/ttylog
This commit is contained in:
parent
eb558a816e
commit
cb74f2f3ca
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue