def connectionLost(self, reason): for i in self.interactors: i.sessionClosed() if self.transport.sessionno in self.factory.sessions: del self.factory.sessions[self.transport.sessionno] self.lastlogExit() if self.ttylog_open: ttylog.ttylog_close(self.ttylog_file, time.time()) self.ttylog_open = False transport.SSHServerTransport.connectionLost(self, reason)
def connectionLost(self, reason): cfg = config() for i in self.interactors: i.sessionClosed() if self.transport.sessionno in self.factory.sessions: del self.factory.sessions[self.transport.sessionno] self.lastlogExit() if self.ttylog_open: ttylog.ttylog_close(self.ttylog_file, time.time()) self.ttylog_open = False if cfg.has_option('smtp', 'alert_quit'): if cfg.get('smtp', 'alert_quit') == 'true': print 'Emailing about attack being over (alert_quit = true).' emailMessage = 'The attacker quit.\n\nPlease check the logs (%s)!' % (self.ttylog_file) sendEmail('SSH Attack Finished', emailMessage) transport.SSHServerTransport.connectionLost(self, reason)
def close_tty(self, ttylog_file): ttylog.ttylog_close(ttylog_file, time.time())
def closeTTY(self, ttylog_file): ttylog.ttylog_close(ttylog_file, time.time())
def connectionLost(self, reason): if self.ttylog_open: ttylog.ttylog_close(self.ttylog_file, time.time()) self.ttylog_open = False insults.ServerProtocol.connectionLost(self, reason)