log keystrokes in loggingserver, not in protocol

This commit is contained in:
Michel Oosterhof 2014-10-04 12:53:40 +00:00
parent c01ef07be1
commit 27304ba9d8
1 changed files with 1 additions and 7 deletions

View File

@ -186,13 +186,6 @@ class HoneyPotInteractiveProtocol(HoneyPotBaseProtocol, recvline.HistoricRecvLin
self.setTypeoverMode()
HoneyPotBaseProtocol.call_command(self, cmd, *args)
def keystrokeReceived(self, keyID, modifier):
transport = self.terminal.transport.session.conn.transport
if type(keyID) == type(''):
ttylog.ttylog_write(transport.ttylog_file, len(keyID),
ttylog.TYPE_INPUT, time.time(), keyID)
recvline.HistoricRecvLine.keystrokeReceived(self, keyID, modifier)
# Easier way to implement password input?
def characterReceived(self, ch, moreCharactersComing):
if self.mode == 'insert':
@ -265,6 +258,7 @@ class LoggingServerProtocol(insults.ServerProtocol):
f = file( transport.stdinlog_file, 'ab' )
f.write(data)
f.close
insults.ServerProtocol.dataReceived(self, data)
# this doesn't seem to be called upon disconnect, so please use
# HoneyPotTransport.connectionLost instead