only log stdin to separate file when using execcmd

This commit is contained in:
Michel Oosterhof 2014-10-04 13:15:06 +00:00
parent 27304ba9d8
commit e75fed058f
1 changed files with 3 additions and 3 deletions

View File

@ -139,9 +139,9 @@ class HoneyPotExecProtocol(HoneyPotBaseProtocol):
def connectionMade(self):
HoneyPotBaseProtocol.connectionMade(self)
self.terminal.transport.session.conn.transport.stdinlog_open = True
self.cmdstack = [core.honeypot.HoneyPotShell(self, interactive=False)]
print 'Running exec command "%s"' % self.execcmd
self.cmdstack[0].lineReceived(self.execcmd)
@ -232,11 +232,11 @@ class LoggingServerProtocol(insults.ServerProtocol):
transport.ttylog_open = True
transport.stdinlog_file = '%s/tty/%s-%s.log' % \
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))
transport.stdinlog_open = True
transport.stdinlog_open = False
insults.ServerProtocol.connectionMade(self)