forked from amitech/web-hacking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hcrack.py
78 lines (59 loc) · 1.81 KB
/
hcrack.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
#!/usr/bin/python
# simple hash cracker working with wordlist
# just for Fun !
'''
888b d888 .d8888b.
8888b d8888 d88P Y88b
88888b.d88888 888 888
888Y88888P888 888
888 Y888P 888 888
888 Y8P 888 888 888
888 " 888 Y88b d88P
888 888 "Y8888P"
Coded by MatriX Coder from tunisia
Use my code as you want :D
'''
import hashlib , sys , os
from platform import system
if system() == 'Linux':
os.system('clear')
if system() == 'Windows':
os.system('cls')
logo = '''
__ __ __
/ / / /_____________ ______/ /__ | ----| Hcrack |----
/ /_/ / ___/ ___/ __ `/ ___/ //_/ | Author : MatriX Coder
/ __ / /__/ / / /_/ / /__/ ,< | FB : www.fb.com/matrixcoder2
/_/ /_/\___/_/ \__,_/\___/_/|_| | Blog : www.matrixcoder.co.vu
Supported algo : md5 | sha1
[*] Usage : python '''+sys.argv[0]+''' hash algo wordlist.txt
'''
print(logo)
def md5(hash1 , pass1):
crypted = hashlib.md5(pass1).hexdigest()
if crypted != hash1:
print(hash1 + ' != ' + str(crypted))
elif crypted == hash1:
print('\t\n----> Cracked : ' + pass1 + '\n')
exit()
def sha1(hash1 , pass1):
crypted = hashlib.sha1(pass1).hexdigest()
if crypted != hash1:
print(hash1 + ' != ' + str(crypted))
elif crypted == hash1:
print('\t\n----> Cracked : ' + pass1 + '\n')
exit()
try:
wordlist = sys.argv[3]
sss = open(wordlist , 'rb')
passes = sss.readlines()
for pass1 in passes:
pass1 = pass1.replace('\n' , '')
algo = sys.argv[2]
hash1 = sys.argv[1]
if algo == 'md5':
md5(hash1 , pass1)
if algo == 'sha1':
sha1(hash1 , pass1)
except IndexError:
pass