./encryption/sha1crack.py

0.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
#!/usr/bin/python
#Attempts to crack a sha1 encrypted hash against any givin wordlist.
#http://darkcode.ath.cx/
#d3hydr8[at]gmail[dot]com 
 
import sys
 
try:
	import hashlib
except(ImportError):
	print "\nYou need the hashlib module installed, try upgrading to python 2.5.\n"
	sys.exit(1)
 
if len(sys.argv) != 3:
	print "Usage: ./sha1crack.py <hash> <wordlist>"
	sys.exit(1)
 
pw = sys.argv[1]
wordlist = sys.argv[2]
try:
  words = open(wordlist, "r")
except(IOError): 
  print "Error: Check your wordlist path\n"
  sys.exit(1)
words = words.readlines()
print "\n",len(words),"words loaded..."
for word in words:
	if pw == hashlib.sha1(word[:-1]).hexdigest(): 
		print "Password is:",word,"\n"
 
 
 
 
 
 
 
 
 

Back