The data stored in Password column are MD5 hashes of the act
Solution
Here we are inputting two files, a file containing hash value of password and another file, wordlist, containing some commonly used passwords in plaintext form.
Program – hash_cracker.py
#Begin hash_cracker.py
import hashlib, sys
m = hashlib.md5()
hashline = \"\"
hash_file = raw_input(\"Enter the hash filename: \")
wordlist = raw_input(\"Enter the wordlist file name: \")
try:
hashdoc = open(hash_file,\"r\")
except IOError:
print \"File not exists.\"
raw_input()
sys.exit()
else:
hashline = hashdoc.readline()
hashline = hashline.replace(\"\ \",\"\")
try:
wordlistfile = open(wordlist,\"r\")
except IOError:
print \"File not exists.\"
raw_input()
sys.exit()
else:
pass
for wordline in wordlistfile:
m = hashlib.md5() #flush the buffer
wordline = wordline.replace(\"\ \",\"\")
m.update(wordline)
word_hash = m.hexdigest()
if word_hash==hashline:
print \"The password corresponding to the hash is \", wordline
raw_input()
sys.exit()
print \"The hash does not match word in the wordlist.\"
raw_input()
sys.exit()
#End of the program

