Skip to content

Commit 1719510

Browse files
author
mohamed larit
authored
Add files via upload
1 parent a65040d commit 1719510

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

crack_hash.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env python
2+
3+
print """
4+
*--------------------------------------*
5+
| programmed by : mohamed |
6+
| fb.me/hack1lab |
7+
*--------------------------------------*
8+
_ _ _ _
9+
| |__ __ _ ___| | _| | __ _| |__
10+
| '_ \ / _` |/ __| |/ / |/ _` | '_ \
11+
| | | | (_| | (__| <| | (_| | |_) |
12+
|_| |_|\__,_|\___|_|\_\_|\__,_|_.__/
13+
14+
python hacking
15+
--------------
16+
"""
17+
import hashlib
18+
from optparse import *
19+
20+
def hashing(word, algorithm):
21+
""" algorithms available: ['md4', 'md5', 'sha1', 'sha256' .... etc] """
22+
hash_type = hashlib.new(algorithm)
23+
hash_type.update(word)
24+
return hash_type.hexdigest()
25+
26+
27+
parser = OptionParser("""
28+
29+
#Usage:
30+
31+
python cracker.py -w <hash> -t <type> -f <word list file>
32+
33+
#Example:
34+
python cracker.py -w 7052cad6b415f4272c1986aa9a50a7c3 -t md5 -f wordlist.txt
35+
""")
36+
parser.add_option("-w",dest="ha_sh",type="string",help="enter hash string")
37+
parser.add_option("-t",dest="ty_pe",type="string",help="enter type the hash")
38+
parser.add_option("-f",dest="fi_le",type="string",help="enter file word list")
39+
(options,args) = parser.parse_args()
40+
if options.ha_sh == None or options.ty_pe == None or options.fi_le == None:
41+
print(parser.usage)
42+
exit(0)
43+
else:
44+
ha_sh = str(options.ha_sh)
45+
ty_pe = str(options.ty_pe)
46+
fi_le = str(options.fi_le)
47+
48+
read_list = open(fi_le,'r')
49+
for word in read_list:
50+
word = word.strip("\n")
51+
result = hashing(word, ty_pe)
52+
print("Testing: "+word)
53+
if ha_sh == result:
54+
print ("\nHash Found: [ {} ] >> word: [ {} ]".format(result,word))
55+
exit(0)
56+
else:
57+
continue
58+
59+
print("\n\thash not found :(\n")

0 commit comments

Comments
 (0)