killchain-compendium/hashes/hash_cracker.py

21 lines
567 B
Python
Raw Normal View History

2021-08-23 01:13:54 +02: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)