md5 forcing (wordlist based)

Download | Vote Up (2) | Vote Down (0)
#!/usr/bin/python2.7                                                                                                   

#fr0g                                                                                                                 

import hashlib
import sys
import time
import re

class _col:
    BLUE = '\033[94m'
    GREEN = '\033[92m'
    RED = '\033[31m'
    ENDC = '\033[0m'

def help():
    print """                                                                                                          
Use : ./getmd5pass.py [wordlist] [hash]                                                                                
                                                                                                                       
example : ./getmd5pass.py my_passlist.txt 51fa1db0ec7c4af52d93a6f5d0e86bc5                                             
                                                                                                                       
(Wordlist : (separated by Line Feed))                                                                                  
"""
    exit(3)

def md5_regex(my_hash):
    if not re.findall(r"([a-fA-F\d]{32})", my_hash) :
        print _col.RED+"\n[X] Error : "+_col.ENDC+"Hash error ..."
        exit(0xd1efa6607)
    else:
        return

if (len(sys.argv) < 3):
    help()
try:
    f = open(sys.argv[1], "r")
except:
    print "File error ..."
    exit(2)

print "...Read the file..."
a = f.read().split("\n")
f.close()
md5_regex(sys.argv[2])

print "Hash : "+sys.argv[2]

print "[!] Job is started ..."
for passwd in a:
    tmp = hashlib.md5()
    tmp.update(str(passwd))
    if (tmp.hexdigest() == sys.argv[2]):
        print "\n"+50*'-'+"\n[!] FOUND : ["+_col.GREEN+tmp.hexdigest()+_col.ENDC+"]"
        print "\n[!] PASSWORD : ["+_col.BLUE+passwd+_col.ENDC+"]"
        print"\nBye ... o/"
        exit(1337)
print _col.RED+"\n[X] "+_col.ENDC+"Sorry , no result found (try another wordlist)"
exit(0)

fr0g


Be the first to give feedback !

Please login to comment !