示例#1
0
    def __init__(self):
        self.running = True

        self.logger = logger
        self.config = config

        self.host_manager = host_manager.HostManager(self.config, logger)

        ca_certs = os.path.join(current_path, "cacert.pem")
        self.openssl_context = SSLContext(
            logger,
            ca_certs=ca_certs,
            support_http2=config.support_http2,
            cipher_suites=[
                'ALL', "!RC4-SHA", "!ECDHE-RSA-RC4-SHA",
                "!ECDHE-RSA-AES128-GCM-SHA256", "!AES128-GCM-SHA256",
                "!ECDHE-RSA-AES128-SHA", "!AES128-SHA"
            ])
        self.connect_creator = ConnectCreator(logger, self.config,
                                              self.openssl_context,
                                              self.host_manager)

        self.appid_manager = AppidManager(self.config, logger)

        self.host_manager.appid_manager = self.appid_manager

        self.check_ip = CheckIp(xlog.null, self.config, self.connect_creator)

        self.ipv4_source = Ipv4RangeSource(
            logger, self.config, os.path.join(current_path, "ip_range.txt"),
            os.path.join(module_data_path, "ip_range.txt"))
        self.ipv6_source = Ipv6PoolSource(
            logger, self.config, os.path.join(current_path, "ipv6_list.txt"))
        self.ip_source = IpCombineSource(logger, self.config, self.ipv4_source,
                                         self.ipv6_source)
        self.ip_manager = IpManager(logger,
                                    self.config,
                                    self.ip_source,
                                    check_local_network,
                                    self.check_ip.check_ip,
                                    None,
                                    os.path.join(module_data_path,
                                                 "good_ip.txt"),
                                    scan_ip_log=None)

        self.appid_manager.check_api = self.check_ip.check_ip
        self.appid_manager.ip_manager = self.ip_manager

        self.connect_manager = ConnectManager(logger, self.config,
                                              self.connect_creator,
                                              self.ip_manager,
                                              check_local_network)

        self.http_dispatcher = HttpsDispatcher(logger, self.config,
                                               self.ip_manager,
                                               self.connect_manager)
示例#2
0
    def start(self):
        self.running = True

        ca_certs = os.path.join(current_path, "cacert.pem")
        self.openssl_context = SSLContext(
            logger,
            ca_certs=ca_certs,
            support_http2=config.support_http2,
            cipher_suites=[
                'ALL', "!RC4-SHA", "!ECDHE-RSA-RC4-SHA",
                "!ECDHE-RSA-AES128-GCM-SHA256", "!AES128-GCM-SHA256",
                "!ECDHE-RSA-AES128-SHA", "!AES128-SHA"
            ])

        self.appid_manager = AppidManager(self.config, logger)

        self.host_manager = host_manager.HostManager(self.config, logger)
        self.host_manager.appid_manager = self.appid_manager

        self.connect_creator = ConnectCreator(logger, self.config,
                                              self.openssl_context,
                                              self.host_manager)

        #self.ip_checker = CheckIp(logger, self.config, self.connect_creator)

        self.ipv6_source = Ipv6PoolSource(logger, self.config, "ipv6_list.txt")
        self.ip_source = self.ipv6_source
        self.ip_manager = IpManager(logger,
                                    self.config,
                                    self.ip_source,
                                    check_local_network,
                                    None,
                                    os.path.join(data_path, "good_ip.txt"),
                                    scan_ip_log=None)

        #self.appid_manager.check_api = self.ip_checker.check_ip
        self.appid_manager.ip_manager = self.ip_manager

        self.connect_manager = ConnectManager(logger, self.config,
                                              self.connect_creator,
                                              self.ip_manager,
                                              check_local_network)

        self.http_dispatcher = HttpsDispatcher(logger, self.config,
                                               self.ip_manager,
                                               self.connect_manager)