[php]
#!/usr/bin/python
# protip: Works fine with SQLMap.
# PoC: http://i55.tinypic.com/t06clj.jpg & http://i53.tinypic.com/5txjrl.jpg
import sys,getopt,re,urllib,urllib2
from socket import*
def linepad(line):
return "-" + line.center(70, " ") + "-"
print linepad("———————————————————————-")
print linepad("")
print linepad("Coded by DiViS0R")
print linepad("Version 1.1")
print linepad("")
print linepad("THX to the hashcracker crew for hosting the best online rainbow table")
print linepad("")
print linepad("SRY to the hashcracker crew for causing traffic :)")
print linepad("")
print linepad("———————————————————————-")
def main():
hashfile = False
hashoutfile = False
replace = False
limit = 1000000000000
try:
opts, args = getopt.getopt(sys.argv[1:], "hf:o:rl:", ["file=", "output=", "help", "replace", "limit="])
except getopt.GetoptError, err:
print str(err) # will print something like "option -a not recognized"
usage()
sys.exit(2)
for o, a in opts:
if o == "-f":
hashfile = a
if o == ‚-o‘:
hashoutfile = a
if o == ‚-r‘:
replace = True
if o == "-l":
limit = a
if o == ‚-h‘:
usage()
sys.exit()
if hashfile is False:
print "No input file specified."
usage()
sys.exit()
FILE = open(hashfile, "r")
content = ‚dummy‘
newfile = “
hashout = “
counter = 0
while (content != "" ) and (counter < int(limit)):
content = FILE.readline()
newfile += content
search = re.search(r'[a-zA-Z0-9]{32}‘, content)
if(search):
counter = counter +1
rhash = search.group()
chash = crkhashcracker(rhash)
if chash is False:
hashout += rhash + ‚\t\t‘ + "Not Found\n"
print rhash + ‚\t\t‘ + "Not Found"
else:
newfile = newfile.replace(rhash, chash.ljust(32, ‚ ‚))
hashout += rhash + "\t" + chash + "\n"
print rhash + ‚\t‘ + chash
FILE.close()
if hashoutfile is not False:
FILE = open(hashoutfile, "w")
if replace is True:
FILE.write(newfile)
else:
FILE.write(hashout)
FILE.close()
sys.exit()
#alternative:
def crkhashkiller(mhash):
params=urllib.urlencode({‚oc_check_md5′:mhash})
f=urllib.urlopen("http://opencrack.hashkiller.com/",params)
content=f.read()
key=re.search(r'[a-zA-Z0-9]{32}:.*(?=<br)‘, content)
if key is None:
return False
else:
chash = key.group()
return chash[chash.index(‚:‘)+1:]
#prefered:
def crkhashcracker(mhash):
f=urllib.urlopen("http://md5.hashcracking.com/search.php?md5="+mhash)
content=f.read()
if content == ‚No results returned.‘:
return False
else:
return content.replace(‚Cleartext of ‚ + mhash + ‚ is ‚, “)
def usage():
print "\n\n"
print "-f \tInput file to get the hashes from"
print "-o \tThe output file to write. Not neccessary."
print "-r \tIf set, the output file will be the input file with replaced hashes."
print "-l \tLimits the number of hashes to crack"
print "-h \tDisplays this information"
print "\n\nNote:\nThe input file format and syntax is not really specified.\nThe script is looking for 32 char long combinations of numbers and letters.\nThis is handy but could also result in misdetection."
main()
[/php]
Liest alle MD5-Hashes einer Datei ein und Crackt sie über eine online Rainbow-Table.
Funktioniert klasse mit sqlmap.
Quelle : http://back2hack.cc/showthread.php?tid=5340&pid=35228#pid35228