def __init__(self, args): super(HttpScan, self).__init__(args) self.session = requesocks.session() adapters.DEFAULT_RETRIES = self.args.max_retries self.tor = None if self.args.tor: self.out.log("Enabling TOR") self.tor = Torify() self.session.proxies = {'http': 'socks5://127.0.0.1:9050', 'https': 'socks5://127.0.0.1:9050'} if self.args.check_tor: # Check TOR self.out.log("Checking IP via TOR") rip, tip = self.tor.check_ip(verbose=True) if tip is None: self.out.log('TOR is not working properly!', logging.ERROR) exit(-1) if self.args.cookies is not None: if path.exists(self.args.cookies) and path.isfile(self.args.cookies): self.cookies = MozillaCookieJar(self.args.cookies) self.cookies.load() else: # self.out.log('Could not find cookie file: %s' % self.args.load_cookies, logging.ERROR) self.cookies = Cookies.from_request(self.args.cookies) else: self.cookies = None self.ua = UserAgent() if self.args.user_agent is None else self.args.user_agent
def __init__(self, args): super(FutureScan, self).__init__(args) self.executor = futures.ThreadPoolExecutor(max_workers=args.threads) self.hosts = file_to_list(args.hosts, 'Hosts file not found!') self.urls = file_to_list(args.urls, 'Urls file not found!') self.tor = Torify()