Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import urllib2, sys, xml.dom.minidom
- def getHash(hash):
- page = urllib2.urlopen('http://hashkiller.com/api/api.php?md5=%s' %hash).read()
- xmld = xml.dom.minidom.parseString(page)
- if xmld.getElementsByTagName('error') and xmld.getElementsByTagName('error')[0].firstChild.data == 'Invalid MD5 Hash':
- print hash + ' is not a valid MD5';
- return
- elif xmld.getElementsByTagName('found') and xmld.getElementsByTagName('found')[0].firstChild.data == "true":
- print hash + ' : ' + xmld.getElementsByTagName('plain')[0].firstChild.data
- else:
- print hash + ' : Not Found Yet. Try again latter.'
- def fromFile(file):
- with open(file,'r') as f:
- for line in f:
- line = line.strip()
- if line.__len__() == 32:
- getHash(line)
- f.close()
- if len(sys.argv) <= 1:
- print "\n|--------------------------------------------------|"
- print "| [email protected] |"
- print "| hashkiller.py |"
- print "| Usage: hashkiller.py [options] |"
- print "| -h help |"
- print "|--------------------------------------------------|\n"
- sys.exit(1)
- for arg in sys.argv:
- if arg == "-h" or arg == "--help":
- print "Options:"
- print " -h, --help shows this help message and exits"
- print " -f <file>, --file=<file> md5 hash list from file\n"
- print " -i <md5>, --input=<md5> direct input of md5 hash\n"
- sys.exit(1)
- count = 0
- for arg in sys.argv:
- if arg == "-f" or arg == "--file":
- file = sys.argv[count+1]
- fromFile(file)
- elif arg == "-i" or arg == "--input":
- hash = sys.argv[count+1]
- getHash(hash)
- count+=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement