From 8733cca51506ace36062b59d7091f7f1424e40c3 Mon Sep 17 00:00:00 2001 From: Michel Oosterhof Date: Wed, 11 Mar 2015 13:46:14 +0000 Subject: [PATCH] updates to logging to fix race condition --- kippo/core/protocol.py | 4 +++- kippo/core/ssh.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kippo/core/protocol.py b/kippo/core/protocol.py index 4fb8a508..98393fca 100644 --- a/kippo/core/protocol.py +++ b/kippo/core/protocol.py @@ -60,8 +60,10 @@ class HoneyPotBaseProtocol(insults.TerminalProtocol): s.close() # this is only called on explicit logout, not on disconnect + # this indicates the closing of the channel/session, not the closing of the connection def connectionLost(self, reason): - log.msg( eventid='KIPP0011', format='Connection lost') + pass + #log.msg( eventid='KIPP0013', format='Session closed') # not sure why i need to do this: # scratch that, these don't seem to be necessary anymore: #del self.fs diff --git a/kippo/core/ssh.py b/kippo/core/ssh.py index a137acb4..301f8020 100644 --- a/kippo/core/ssh.py +++ b/kippo/core/ssh.py @@ -227,12 +227,12 @@ class HoneyPotTransport(sshserver.KippoSSHServerTransport): # this seems to be the only reliable place of catching lost connection def connectionLost(self, reason): - log.msg( "Connection Lost in SSH Transport" ) for i in self.interactors: i.sessionClosed() if self.transport.sessionno in self.factory.sessions: del self.factory.sessions[self.transport.sessionno] sshserver.KippoSSHServerTransport.connectionLost(self, reason) + log.msg( eventid='KIPP0011', format='Connection lost') class HoneyPotSSHSession(session.SSHSession):