def query_search(url): sublist = [] engine_urls = [ 'https://www.virustotal.com/en/domain/%s/information/', 'https://www.google.com/search?q=site:%s&num=100', 'https://search.yahoo.com/search?p=%s&b=1' ] i = 0 for engine in engine_urls: request_handler = RequestHandler() data = request_handler.send(engine % url.replace("http://", "")) if data == 'None': return None soup = BeautifulSoup(data, "lxml") results = set( re.findall(r"\w+\.{}".format(url.replace("http://", "")), soup.text)) for subdomain in results: if "www." not in subdomain: output = GREEN + "%s\n" % (subdomain) + RESET sublist.append(output) i += 1 progressBar = ProgressBar() progressBar.progress(i, len(engine_urls), status='Searching') return sublist
def brute_all(self): threads = [] num_lines = sum(1 for line in open(self.wordlist)) count = 0 with open(self.wordlist) as f: for line in f: newurl = self.createurl(self.target.rstrip(), line.rstrip()) at = threading.activeCount() if at <= 10: thread = threading.Thread(target=self.request, args=(newurl,)) threads.append(thread) thread.start() else: self.request(newurl) count += 1 progressBar = ProgressBar() progressBar.progress(count, num_lines, status='Brute-forcing') sys.stdout.write('\n- Wait for all threads to finish\n') for x in threads: x.join() return self.sublist