Exemplo n.º 1
0
    def __init__(self):
        super(POP3Service, self).__init__()

        self._name = config.pop3Name
        self._port = config.pop3Port
        self._limiter = Limiter(self._fService, config.pop3Name, config.POP3_conn_per_host)

        self.protocol = POP3Protocol
        self._fService.protocol = self.protocol
Exemplo n.º 2
0
    def __init__(self):
        super(IMAPSService, self).__init__()

        self._name = config.imapsName
        self._port = config.imapsPort
        self._limiter = Limiter(self._fService, config.imapsName, config.IMAPS_conn_per_host)

        self.protocol = IMAPProtocol
        self._fService.protocol = self.protocol
Exemplo n.º 3
0
    def __init__(self):
        super(HTTPService, self).__init__()

        self._name = Config.http.name
        self._port = Config.http.port
        self._limiter = Limiter(self._fService, Config.http.name, Config.http.connections_per_host)

        self.protocol = HTTPProtocol
        self._fService.protocol = self.protocol
Exemplo n.º 4
0
    def __init__(self):
        super(TelnetService, self).__init__()

        self._name = Config.telnet.name
        self._port = Config.telnet.port

        self._fService = TelnetFactory()

        self._limiter = Limiter(self._fService, Config.telnet.name, Config.telnet.connections_per_host)
Exemplo n.º 5
0
    def __init__(self):
        super(POP3Service, self).__init__()

        self._name = Config.pop3.name
        self._port = Config.pop3.port
        self._limiter = Limiter(self._fService, Config.pop3.name, Config.pop3.connections_per_host)

        self.protocol = POP3Protocol
        self._fService.protocol = self.protocol
Exemplo n.º 6
0
    def __init__(self):
        super(SMTPService, self).__init__()

        self._name = config.smtpName
        self._port = config.smtpPort
        self._limiter = Limiter(self._fService, config.smtpName,
                                config.SMTP_conn_per_host)

        self.protocol = SMTPProtocol
        self._fService.protocol = self.protocol
Exemplo n.º 7
0
    def __init__(self):
        super(IMAPSService, self).__init__()

        self._name = Config.imaps.name
        self._port = Config.imaps.port
        self._limiter = Limiter(self._fService, Config.imaps.name,
                                Config.imaps.connections_per_host)

        self.protocol = IMAPProtocol
        self._fService.protocol = self.protocol
Exemplo n.º 8
0
    def __init__(self):
        super(S7commService, self).__init__()

        self._name = Config.s7comm.name
        self._port = Config.s7comm.port
        self._limiter = Limiter(self._fService, Config.s7comm.name, Config.s7comm.connections_per_host)
        self.server = Server()

        global global_server
        global_server = self.server
Exemplo n.º 9
0
    def __init__(self):
        super(TelnetService, self).__init__()

        self._name = config.telnetName
        self._port = config.telnetPort

        self._fService = TelnetFactory()

        self._limiter = Limiter(self._fService, config.telnetName,
                                config.Telnet_conn_per_host)
Exemplo n.º 10
0
    def __init__(self):
        super(SSHService, self).__init__()

        self._name = Config.ssh.name
        self._port = Config.ssh.port

        p = Portal(SSHRealm())
        p.registerChecker(SSHService.honeytokendb)

        self._fService = factory.SSHFactory()
        self._fService.services[b'ssh-userauth'] = groveUserAuth

        self._limiter = Limiter(self._fService, Config.ssh.name,
                                Config.ssh.connections_per_host)

        self._fService.portal = p

        # self.protocol = SSHProtocol
        # self._fService.protocol = self.protocol
        home = expanduser('~')

        # XXX: These paths should be configurable
        privateKeyPath = home + '/.ssh/id_honeygrove'
        publicKeyPath = home + '/.ssh/id_honeygrove.pub'

        # Generate RSA keys if they don't exist
        if not (exists(privateKeyPath) and exists(publicKeyPath)):
            key = keys.rsa.generate_private_key(public_exponent=65537,
                                                key_size=4096,
                                                backend=default_backend())
            private_key = key.private_bytes(
                serialization.Encoding.PEM,
                serialization.PrivateFormat.TraditionalOpenSSL,
                serialization.NoEncryption())
            public_key = key.public_key().public_bytes(
                serialization.Encoding.OpenSSH,
                serialization.PublicFormat.OpenSSH)

            # make .ssh directory, if it doesn't exist
            os.makedirs(dirname(publicKeyPath), exist_ok=True)

            with open(privateKeyPath, 'w') as f:
                f.write(private_key.decode())
            with open(publicKeyPath, 'w') as f:
                f.write(public_key.decode())

        self._fService.privateKeys = {
            b'ssh-rsa': keys.Key.fromFile(privateKeyPath)
        }
        self._fService.publicKeys = {
            b'ssh-rsa': keys.Key.fromFile(publicKeyPath)
        }
Exemplo n.º 11
0
    def __init__(self):

        super(FTPService, self).__init__()

        portal = Portal(FTPRealm('./'), [self.credchecker])

        self._fService = FTPFactory(portal)

        self._name = config.ftpName
        self._port = config.ftpPort

        self._limiter = Limiter(self._fService, self._name, config.FTP_conn_per_host)

        self.protocol = FTPProtocol
        self._fService.protocol = self.protocol