killchain-compendium/Cryptography/Hashes/Scripts/hash_cracker.py

21 lines
567 B
Python
Raw Normal View History

2022-11-12 23:18:06 +01:00
#!/usr/bin/env python
import hashlib
import pyfiglet
print(pyfiglet.figlet_format("md5 cracker"))
wordlist_location = str(input("Wordlist file location: "))
hash_input = str(input("Enter hash to be cracked: "))
with open(wordlist_location, 'rb') as _f:
for line in _f.readlines():
line = line.strip()
hash_ob = hashlib.sha256(line)
#hash_ob = hashlib.md5(line)
hashed_pass = hash_ob.hexdigest()
print(line)
if hashed_pass == hash_input:
print("Password found: " + line.decode())
exit(0)