Skip to content

Commit 415bf34

Browse files
authored
Create sha256password-cracker.py
1 parent 69ec32b commit 415bf34

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

sha256password-cracker.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 sys
3+
4+
if len(sys.argv) !=2:
5+
print("Invalid Arguements!")
6+
print(">> {} <sha256sum>".format(sys.argv[0]))
7+
exit()
8+
9+
wanted_hash = sys.argv[1]
10+
password_file = "/usr/share/wordlists/rockyou.txt"
11+
attempts = 0
12+
13+
with log.progress("Attempting to back: {}!\n".format(wanted_hash)) as p:
14+
with open(password_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 ! {} hashes to {} !".format(attempts, password.decode('latin-1'), password_hash))
21+
exit()
22+
attempts += 1
23+
p.failure("Password hash not found!")

0 commit comments

Comments
 (0)