Ejemplo n.º 1
0
Archivo: ssh.py Proyecto: imoore/cowrie
 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
Ejemplo n.º 2
0
Archivo: ssh.py Proyecto: 0x4ndr3/kippo
 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
Ejemplo n.º 3
0
    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