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