Skip to content

Commit 28aa474

Browse files
author
mohamed larit
authored
Add files via upload
1 parent 000c2fc commit 28aa474

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

cracker.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+
35+
python cracker.py -w 7052cad6b415f4272c1986aa9a50a7c3 -t md5 -f wordlist.txt
36+
""")
37+
parser.add_option("-w",dest="ha_sh",type="string",help="enter hash string")
38+
parser.add_option("-t",dest="ty_pe",type="string",help="enter type the hash")
39+
parser.add_option("-f",dest="fi_le",type="string",help="enter file word list")
40+
(options,args) = parser.parse_args()
41+
if options.ha_sh == None or options.ty_pe == None or options.fi_le == None:
42+
print(parser.usage)
43+
exit(0)
44+
else:
45+
ha_sh = str(options.ha_sh)
46+
ty_pe = str(options.ty_pe)
47+
fi_le = str(options.fi_le)
48+
49+
read_list = open(fi_le,'r')
50+
for word in read_list:
51+
word = word.strip("\n")
52+
result = hashing(word, ty_pe)
53+
print("Testing: "+word)
54+
if ha_sh == result:
55+
print ("\nHash Found: [ {} ] >> word: [ {} ]".format(result,word))
56+
exit(0)
57+
else:
58+
continue
59+
60+
print("\n\thash not found :(\n")

0 commit comments

Comments
 (0)