-
Notifications
You must be signed in to change notification settings - Fork 53
/
hashcracker.py
91 lines (82 loc) · 2.78 KB
/
hashcracker.py
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/python
# __ _ __ _
# / /_ __ __ ______________ _____ __ __ (_)_ ______ / /__(_)__
# / __ \/ / / / / ___/ ___/ __ `/_ / / / / / / / / / / __ \/ //_/ / _ \
# / /_/ / /_/ / / /__/ / / /_/ / / /_/ /_/ / / / /_/ / / / / ,< / / __/
# /_.___/\__, / \___/_/ \__,_/ /___/\__, /_/ /\__,_/_/ /_/_/|_/_/\___/
# /____/ /____/___/
#
###############################################################################
Download huge collections of wordlist:#
http://ul.to/folder/j7gmyz#
##########################################################################
####################################################################
Need daylie updated proxies?#
http://j.mp/Y7ZZq9#
################################################################
######################################################
#### Hash Crack ######
###################################################
#Attempts to crack hash ( md5, sha1, sha256, sha384, sha512) against any givin wordlist.
import os, sys ,hashlib
if len(sys.argv) != 4:
print " \n by ..:: crazyjunkie ::.."
print "\n\nUsage: ./hash.py <hash algorithm > <hash> <wordlist>"
print "\n Example: /hash.py <md5 or sha1 or sha256 or sha384 or sha512> <hash> <wordlist>"
sys.exit(1)
algo=sys.argv[1]
pw = sys.argv[2]
wordlist = sys.argv[3]
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..."
file=open('cracked.txt','a')
if algo == 'md5':
for word in words:
hash = hashlib.md5(word[:-1])
value = hash.hexdigest()
if pw == value:
print "Password is:",word,"\n"
file.write("\n Cracked Hashes\n\n")
file.write(pw+"\t\t")
file.write(word+"\n")
if algo == 'sha1':
for word in words:
hash = hashlib.sha1(word[:-1])
value = hash.hexdigest()
if pw == value:
print "Password is:",word,"\n"
file.write("\n Cracked Hashes\n\n")
file.write(pw+"\t\t")
file.write(word+"\n")
if algo == 'sha256':
for word in words:
hash = hashlib.sha256(word[:-1])
value = hash.hexdigest()
if pw == value:
print "Password is:",word,"\n"
file.write("\n Cracked Hashes\n\n")
file.write(pw+"\t\t")
file.write(word+"\n")
if algo == 'sha384':
for word in words:
hash = hashlib.sha384(word[:-1])
value = hash.hexdigest()
if pw == value:
print "Password is:",word,"\n"
file.write("\n Cracked Hashes\n\n")
file.write(pw+"\t\t")
file.write(word+"\n")
if algo == 'sha512':
for word in words:
hash = hashlib.sha512(word[:-1])
value = hash.hexdigest()
if pw == value:
print "Password is:",word,"\n"
file.write("\n Cracked Hashes\n\n")
file.write(pw+"\t\t")
file.write(word+"\n")