Ejemplo n.º 1
0
    def connection_made(self, end_ip, end_port, honey_ip, honey_port, sensor_name):
        plugin_list = plugins.get_plugin_list(plugin_type='output')
        self.loaded_plugins = plugins.import_plugins(plugin_list)

        dt = self.get_date_time()
        self.sensor_name = sensor_name
        self.honey_ip = honey_ip
        self.honey_port = str(honey_port)
        self.end_ip = end_ip
        self.end_port = str(end_port)
        self.session_id = uuid.uuid4().hex
        self.logLocation = self.cfg.get(['folders', 'session_path']) + "/" + self.sensor_name + "/" + end_ip + "/"

        self.downloadFolder = self.logLocation + 'downloads/'

        for plugin in self.loaded_plugins:
            plugin_name = plugins.get_plugin_name(plugin)
            for plugin_server in self.plugin_servers:
                if plugin_server['name'] == plugin_name:
                    plugins.run_plugins_function([plugin], 'set_server', False, plugin_server['server'])
                    break

        country = self.cname(self.end_ip)
        if not country:
            country = ''

        session = self.connections.add_session(self.sensor_name, self.end_ip, self.end_port, dt, self.honey_ip,
                                               self.honey_port, self.session_id, self.logLocation, country)
        plugins.run_plugins_function(self.loaded_plugins, 'connection_made', True, session)
Ejemplo n.º 2
0
    def connectionMade(self, end_ip, end_port, honey_ip, honey_port, sensor_name):
        plugin_list = plugins.get_plugin_list(type='output')
        self.loaded_plugins = plugins.import_plugins(plugin_list, self.cfg)
        
        dt = self.getDateTime()
        self.sensor_name = sensor_name
        self.honey_ip = honey_ip
        self.honey_port = str(honey_port)
        self.end_ip = end_ip
        self.end_port = str(end_port)
        self.session_id = uuid.uuid4().hex        
        self.logLocation = self.cfg.get('folders', 'session_path') + "/" + self.sensor_name + "/"+ end_ip + "/"
        
        self.downloadFolder = self.logLocation + 'downloads/'

        for plugin in self.loaded_plugins:
            plugin_name = plugins.get_plugin_name(plugin)
            for plugin_server in self.plugin_servers:
                if plugin_server['name'] == plugin_name:
                    plugins.run_plugins_function([plugin], 'set_server', False, plugin_server['server'])
                    break
        
        country = self.cname(self.end_ip)
        if not country:
            country = ''

        session = self.connections.add_session(self.sensor_name, self.end_ip, self.end_port, dt, self.honey_ip, self.honey_port, self.session_id, self.logLocation, country)
        plugins.run_plugins_function(self.loaded_plugins, 'connection_made', True, session)
Ejemplo n.º 3
0
    def __init__(self):
        self.ourVersionString = self.cfg.get('honeypot', 'ssh_banner')
        if self.ourVersionString == '':
            log.msg(log.LPURPLE, '[SERVER]',
                    'Acquiring SSH Version String from honey_ip:honey_port')
            clientFactory = client.HonsshSlimClientFactory()
            clientFactory.server = self

            reactor.connectTCP(
                self.cfg.get('honeypot-static', 'honey_ip'),
                int(self.cfg.get('honeypot-static', 'honey_port')),
                clientFactory)
        else:
            log.msg(
                log.LPURPLE, '[SERVER]',
                'Using ssh_banner for SSH Version String: ' +
                self.ourVersionString)

        plugin_list = plugins.get_plugin_list(type='output')
        loaded_plugins = plugins.import_plugins(plugin_list, self.cfg)
        for plugin in loaded_plugins:
            plugin_server = plugins.run_plugins_function([plugin],
                                                         'start_server', False)
            plugin_name = plugins.get_plugin_name(plugin)
            self.plugin_servers.append({
                'name': plugin_name,
                'server': plugin_server
            })

        if self.ourVersionString != '':
            log.msg(log.LGREEN, '[HONSSH]',
                    'HonSSH Boot Sequence Complete - Ready for attacks!')
Ejemplo n.º 4
0
    def __init__(self):
        self.cfg = Config.getInstance()
        self.otherVersionString = ''
        self.connections = connections.Connections()
        self.plugin_servers = []
        self.ourVersionString = self.cfg.get(['honeypot', 'ssh_banner'])

        if len(self.ourVersionString) > 0:
            log.msg(log.LPURPLE, '[SERVER]', 'Using ssh_banner for SSH Version String: ' + self.ourVersionString)
        else:
            if self.cfg.getboolean(['honeypot-static', 'enabled']):
                log.msg(log.LPURPLE, '[SERVER]', 'Acquiring SSH Version String from honey_ip:honey_port')
                client_factory = client.HonsshSlimClientFactory()
                client_factory.server = self

                reactor.connectTCP(self.cfg.get(['honeypot-static', 'honey_ip']),
                                   int(self.cfg.get(['honeypot-static', 'honey_port'])), client_factory)
            elif self.cfg.getboolean(['honeypot-docker', 'enabled']):
                log.msg(log.LRED, '[SERVER][ERR]', 'You need to configure the ssh_banner for docker manually!')

        plugin_list = plugins.get_plugin_list()
        loaded_plugins = plugins.import_plugins(plugin_list)
        for plugin in loaded_plugins:
            plugin_server = plugins.run_plugins_function([plugin], 'start_server', False)
            plugin_name = plugins.get_plugin_name(plugin)
            self.plugin_servers.append({'name': plugin_name, 'server': plugin_server})

        if self.ourVersionString != '':
            log.msg(log.LGREEN, '[HONSSH]', 'HonSSH Boot Sequence Complete - Ready for attacks!')
Ejemplo n.º 5
0
 def __init__(self):
     self.ourVersionString = self.cfg.get('honeypot', 'ssh_banner')
     if self.ourVersionString == '':
         log.msg(log.LPURPLE, '[SERVER]', 'Acquiring SSH Version String from honey_ip:honey_port')
         clientFactory = client.HonsshSlimClientFactory()
         clientFactory.server = self
         
         reactor.connectTCP(self.cfg.get('honeypot-static', 'honey_ip'), int(self.cfg.get('honeypot-static', 'honey_port')), clientFactory)
     else:
         log.msg(log.LPURPLE, '[SERVER]', 'Using ssh_banner for SSH Version String: ' + self.ourVersionString)
     
     plugin_list = plugins.get_plugin_list(type='output')
     loaded_plugins = plugins.import_plugins(plugin_list, self.cfg)
     for plugin in loaded_plugins:
         plugin_server = plugins.run_plugins_function([plugin], 'start_server', False)
         plugin_name = plugins.get_plugin_name(plugin)
         self.plugin_servers.append({'name':plugin_name, 'server':plugin_server})
         
     if self.ourVersionString != '':    
         log.msg(log.LGREEN, '[HONSSH]', 'HonSSH Boot Sequence Complete - Ready for attacks!')