def execCommand(self, proto, cmd): serverProtocol = protocol.LoggingServerProtocol( protocol.HoneyPotExecProtocol, self, self.env, cmd) self.protocol = serverProtocol serverProtocol.makeConnection(proto) proto.makeConnection(session.wrapProtocol(serverProtocol)) self.protocol = serverProtocol
def openShell(self, proto): serverProtocol = protocol.LoggingServerProtocol( protocol.HoneyPotInteractiveProtocol, self, self.env) serverProtocol.makeConnection(proto) proto.makeConnection(session.wrapProtocol(serverProtocol)) #self.protocol = serverProtocol self.protocol = proto
def execCommand(self, proto, cmd): cfg = config() if not cfg.has_option('honeypot', 'exec_enabled') or \ cfg.get('honeypot', 'exec_enabled').lower() not in \ ('yes', 'true', 'on'): log.msg('Exec disabled. Not executing command: "%s"' % cmd) raise exceptions.NotEnabledException( 'exec_enabled not enabled in configuration file!') return serverProtocol = protocol.LoggingServerProtocol( protocol.HoneyPotExecProtocol, self, self.env, cmd) self.protocol = serverProtocol serverProtocol.makeConnection(proto) proto.makeConnection(session.wrapProtocol(serverProtocol)) self.protocol = serverProtocol