Here is my code:
import hashlib
print("Generating Hashes...")
hash_table = {}
def crack(Hash=None):
if Hash in hash_table:
print "MATCH\n",hash_table[Hash]
else:
print "NO MATCH"
with open('dictionary','r') as inp_file:
for word in inp_file.readlines():
word = word.strip()
for salt in range(0,256):
salt = str(salt)
final = salt+word
#print final
final = final.encode('iso-8859-1')
hash_table[hashlib.md5(final).hexdigest()] = salt+word
#print hash_table
with open('shadow3','r') as inp_file2:
for line in inp_file2.readlines():
line = line.strip()
line1 = line.split(":")[1:]
print line1[0]
crack(line1[0])
here is the provided shadow file
tleela:72fd3dbc120ea01dd9e7c68d6f257181 hfarnsworth:204b319de6f41bbfdbcb28da724dda23 jzoidberg:a08a9e38a28e64583700b20a8251c2ba brodrgue:eac6bf62c93cbe3f9f934b5143d945e4 pfry:e262e88b10ea1bcdbb385e74216d3a7a awong:fe58b4b4cecd58d47b08b1916fae00ac hconrad:4cdbade3215a250eb5607a1127b8f755
and here is the result I am currently getting. only one password is found:
Desktop/pyhton1# python hash1.py Generating Hashes... 72fd3dbc120ea01dd9e7c68d6f257181 NO MATCH 204b319de6f41bbfdbcb28da724dda23 NO MATCH a08a9e38a28e64583700b20a8251c2ba NO MATCH eac6bf62c93cbe3f9f934b5143d945e4 NO MATCH e262e88b10ea1bcdbb385e74216d3a7a MATCH 6expression fe58b4b4cecd58d47b08b1916fae00ac NO MATCH 4cdbade3215a250eb5607a1127b8f755 NO MATCH
I've also attached the dictionary file if needed
Dictionary file didn't attach for some reason. Sorry.
Attached File(s)
-
dictionary.txt (8.04K)
Number of downloads: 19

New Topic/Question
Reply



MultiQuote





|