예제 #1
0
    def intialise_proxy_manager(options):
        """ Proxy Manager initialization.

        :param dict options: Proxy manager configuration parameters.
        """
        proxy_manager = None
        if options['Botnet_mode'] is not None:
            proxy_manager = Proxy_manager()
            answer = "Yes"
            proxies = []
            if options['Botnet_mode'][0] == "miner":
                miner = Proxy_Miner()
                proxies = miner.start_miner()

            if options['Botnet_mode'][0] == "list":  # load proxies from list
                proxies = proxy_manager.load_proxy_list(
                    options['Botnet_mode'][1]
                )
                answer = raw_input(
                    "[#] Do you want to check the proxy list? [Yes/no] : "
                )

            if answer.upper() in ["", "YES", "Y"]:
                proxy_q = multiprocessing.Queue()
                proxy_checker = multiprocessing.Process(
                    target=Proxy_Checker.check_proxies,
                    args=(proxy_q, proxies,)
                )
                logging.info("Checking Proxies...")
                start_time = time.time()
                proxy_checker.start()
                proxies = proxy_q.get()
                proxy_checker.join()

            proxy_manager.proxies = proxies
            proxy_manager.number_of_proxies = len(proxies)

            if options['Botnet_mode'][0] == "miner":
                logging.info("Writing proxies to disk(~/.owtf/proxy_miner/proxies.txt)")
                miner.export_proxies_to_file("proxies.txt", proxies)
            if answer.upper() in ["", "YES", "Y"]:
                logging.info(
                    "Proxy Check Time: %s",
                    time.strftime(
                        '%H:%M:%S',
                        time.localtime(time.time() - start_time - 3600)
                    )
                )
                cprint("Done")

            if proxy_manager.number_of_proxies is 0:
                ServiceLocator.get_component("error_handler").FrameworkAbort("No Alive proxies.")

            proxy = proxy_manager.get_next_available_proxy()

            # check proxy var... http:// sock://
            options['OutboundProxy'] = []
            options['OutboundProxy'].append(proxy["proxy"][0])
            options['OutboundProxy'].append(proxy["proxy"][1])
예제 #2
0
    def intialise_proxy_manager(options):
        """ Proxy Manager initialization.

        :param dict options: Proxy manager configuration parameters.
        """
        proxy_manager = None
        if options['Botnet_mode'] is not None:
            proxy_manager = Proxy_manager()
            answer = "Yes"
            proxies = []
            if options['Botnet_mode'][0] == "miner":
                miner = Proxy_Miner()
                proxies = miner.start_miner()

            if options['Botnet_mode'][0] == "list":  # load proxies from list
                proxies = proxy_manager.load_proxy_list(
                    options['Botnet_mode'][1])
                answer = raw_input(
                    "[#] Do you want to check the proxy list? [Yes/no] : ")

            if answer.upper() in ["", "YES", "Y"]:
                proxy_q = multiprocessing.Queue()
                proxy_checker = multiprocessing.Process(
                    target=Proxy_Checker.check_proxies,
                    args=(
                        proxy_q,
                        proxies,
                    ))
                logging.info("Checking Proxies...")
                start_time = time.time()
                proxy_checker.start()
                proxies = proxy_q.get()
                proxy_checker.join()

            proxy_manager.proxies = proxies
            proxy_manager.number_of_proxies = len(proxies)

            if options['Botnet_mode'][0] == "miner":
                logging.info(
                    "Writing proxies to disk(~/.owtf/proxy_miner/proxies.txt)")
                miner.export_proxies_to_file("proxies.txt", proxies)
            if answer.upper() in ["", "YES", "Y"]:
                logging.info(
                    "Proxy Check Time: %s",
                    time.strftime(
                        '%H:%M:%S',
                        time.localtime(time.time() - start_time - 3600)))
                cprint("Done")

            if proxy_manager.number_of_proxies is 0:
                ServiceLocator.get_component("error_handler").FrameworkAbort(
                    "No Alive proxies.")

            proxy = proxy_manager.get_next_available_proxy()

            # check proxy var... http:// sock://
            options['OutboundProxy'] = []
            options['OutboundProxy'].append(proxy["proxy"][0])
            options['OutboundProxy'].append(proxy["proxy"][1])
예제 #3
0
파일: core.py 프로젝트: ovnicraft/owtf
    def StartBotnetMode(self, Options):
        self.Proxy_manager = None
        if Options['Botnet_mode'] != None:
            self.Proxy_manager = Proxy_manager()
            answer = "Yes"
            proxies = []
            if Options['Botnet_mode'][0] == "miner":
                miner = Proxy_Miner()
                proxies = miner.start_miner()

            if Options['Botnet_mode'][0] == "list":  # load proxies from list
                proxies = self.Proxy_manager.load_proxy_list(
                    Options['Botnet_mode'][1])
                answer = raw_input(
                    "[#] Do you want to check the proxy list? [Yes/no] : ")

            if answer.upper() in ["", "YES", "Y"]:
                proxy_q = Queue()
                proxy_checker = Process(target=Proxy_Checker.check_proxies,
                                        args=(
                                            proxy_q,
                                            proxies,
                                        ))
                cprint("Checking Proxies...")
                #cprint("Start Time: " + time.strftime('%H:%M:%S', time.localtime(time.time())))
                start_time = time.time()
                proxy_checker.start()
                proxies = proxy_q.get()
                proxy_checker.join()

            self.Proxy_manager.proxies = proxies
            self.Proxy_manager.number_of_proxies = len(proxies)

            if Options['Botnet_mode'][0] == "miner":
                print "Writing Proxies to disk(~/.owtf/proxy_miner/proxies.txt)"
                miner.export_proxies_to_file("proxies.txt", proxies)
            if answer.upper() in ["", "YES", "Y"]:
                cprint("Proxy Check Time: " +\
                        time.strftime('%H:%M:%S',
                        time.localtime(time.time() - start_time - 3600)
                                      )
                       )
                cprint("Done")

            proxy = self.Proxy_manager.get_next_available_proxy()

            #check proxy var... http:// sock://
            Options['OutboundProxy'] = []
            Options['OutboundProxy'].append(proxy["proxy"][0])
            Options['OutboundProxy'].append(proxy["proxy"][1])
예제 #4
0
파일: core.py 프로젝트: NabilNoaman/owtf
    def StartBotnetMode(self, Options):
        self.Proxy_manager = None
        if Options['Botnet_mode'] != None:
            self.Proxy_manager = Proxy_manager()
            answer = "Yes"
            proxies = []
            if Options['Botnet_mode'][0] == "miner":
                miner = Proxy_Miner()
                proxies = miner.start_miner()

            if Options['Botnet_mode'][0] == "list":  # load proxies from list
                proxies = self.Proxy_manager.load_proxy_list(Options['Botnet_mode'][1])
                answer = raw_input("[#] Do you want to check the proxy list? [Yes/no] : ")

            if answer.upper() in ["", "YES", "Y"]:
                proxy_q = Queue()
                proxy_checker = Process(
                                        target=Proxy_Checker.check_proxies,
                                        args=(proxy_q, proxies,)
                                        )
                cprint("Checking Proxies...")
                #cprint("Start Time: " + time.strftime('%H:%M:%S', time.localtime(time.time())))
                start_time = time.time()
                proxy_checker.start()
                proxies = proxy_q.get()
                proxy_checker.join()

            self.Proxy_manager.proxies = proxies
            self.Proxy_manager.number_of_proxies = len(proxies)

            if Options['Botnet_mode'][0] == "miner":
                print "Writing Proxies to disk(~/.owtf/proxy_miner/proxies.txt)"
                miner.export_proxies_to_file("proxies.txt", proxies)
            if answer.upper() in ["", "YES", "Y"]:
                cprint("Proxy Check Time: " +\
                        time.strftime('%H:%M:%S',
                        time.localtime(time.time() - start_time - 3600)
                                      )
                       )
                cprint("Done")

            proxy = self.Proxy_manager.get_next_available_proxy()

            #check proxy var... http:// sock://
            Options['OutboundProxy'] = []
            Options['OutboundProxy'].append(proxy["proxy"][0])
            Options['OutboundProxy'].append(proxy["proxy"][1])