-
Notifications
You must be signed in to change notification settings - Fork 5
/
masher.py
143 lines (115 loc) · 3.53 KB
/
masher.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/usr/bin/python3
import hashlib, sys
salt=""
password=""
if len(sys.argv)==2:
password = sys.argv[1]
salt = ""
elif len(sys.argv)==3:
password = sys.argv[1]
salt = sys.argv[2]
else:
print('masher v1.0 - trustwave spiderlabs')
print('[!] No input specified. Please use the format: masher.py <password> <salt>')
print('[-] The salt is optional')
sys.exit()
print('masher v1.0 - trustwave spiderlabs')
print('[-] using password: '+password)
print('[-] using salt: '+salt)
m = hashlib.md5()
m.update(password.encode('UTF-8'))
print('MD5: '+ m.hexdigest())
m = hashlib.sha1()
m.update(password.encode('UTF-8'))
print('SHA-1: '+ m.hexdigest())
m = hashlib.sha224()
m.update(password.encode('UTF-8'))
print('SHA-224: '+ m.hexdigest())
m = hashlib.sha256()
m.update(password.encode('UTF-8'))
print('SHA-256: '+ m.hexdigest())
m = hashlib.sha384()
m.update(password.encode('UTF-8'))
print('SHA-384: '+ m.hexdigest())
m = hashlib.sha512()
m.update(password.encode('UTF-8'))
print('SHA-512: '+ m.hexdigest())
m = hashlib.sha3_224()
m.update(password.encode('UTF-8'))
print('SHA3-224: '+ m.hexdigest())
m = hashlib.sha3_256()
m.update(password.encode('UTF-8'))
print('SHA3-256: '+ m.hexdigest())
m = hashlib.sha3_384()
m.update(password.encode('UTF-8'))
print('SHA3-384: '+ m.hexdigest())
m = hashlib.sha3_512()
m.update(password.encode('UTF-8'))
print('SHA3-512: '+ m.hexdigest())
print('*MIX AND MATCH*')
m = hashlib.md5()
m.update((password+salt).encode('UTF-8'))
print('MD5(PASSSALT): '+m.hexdigest())
m = hashlib.md5()
m.update((salt+password).encode('UTF-8'))
print('MD5(SALTPASS): '+m.hexdigest())
m = hashlib.md5()
m.update((salt+password+salt).encode('UTF-8'))
print('MD5(SALTPASSSALT): '+m.hexdigest())
m = hashlib.md5()
m2 = hashlib.md5()
m.update((salt+password).encode('UTF-8'))
m2.update(m.digest())
print('MD5(MD5(SALTPASS)): '+m2.hexdigest())
m = hashlib.md5()
m2 = hashlib.md5()
m.update(password.encode('UTF-8'))
m2.update(m.digest())
print('MD5(MD5(PASS): '+m2.hexdigest())
m = hashlib.md5()
m2 = hashlib.md5()
m3 = hashlib.md5()
m.update(salt.encode('UTF-8'))
m2.update(password.encode('UTF-8'))
m3.update(m.digest()+m2.digest())
print('MD5((MD5SALT)(MD5PASS)): '+m3.hexdigest())
m = hashlib.sha1()
m.update((password+salt).encode('UTF-8'))
print('SHA1(PASSSALT): '+m.hexdigest())
m = hashlib.sha1()
m.update((salt+password).encode('UTF-8'))
print('SHA1(SALTPASS): '+m.hexdigest())
m = hashlib.sha1()
m.update((salt+password+salt).encode('UTF-8'))
print('SHA1(SALTPASSSALT): '+m.hexdigest())
m = hashlib.sha1()
m2 = hashlib.sha1()
m.update((salt+password).encode('UTF-8'))
m2.update(m.digest())
print('SHA1(SHA1(SALTPASS)): '+m2.hexdigest())
m = hashlib.sha1()
m2 = hashlib.sha1()
m.update(password.encode('UTF-8'))
m2.update(m.digest())
print('SHA1(SHA1(PASS): '+m2.hexdigest())
m = hashlib.sha1()
m2 = hashlib.sha1()
m3 = hashlib.sha1()
m.update(password.encode('UTF-8'))
m2.update(m.digest())
m3.update(m2.digest())
print('SHA1(SHA1(SHA1(PASS): '+m3.hexdigest())
m = hashlib.sha1()
m2 = hashlib.sha1()
m3 = hashlib.sha1()
m.update((salt+password).encode('UTF-8'))
m2.update(m.digest())
m3.update(m2.digest())
print('SHA1(SHA1(SHA1(SALTPASS)): '+m3.hexdigest())
m = hashlib.sha1()
m2 = hashlib.sha1()
m3 = hashlib.sha1()
m.update(salt.encode('UTF-8'))
m2.update(password.encode('UTF-8'))
m3.update(m.digest()+m2.digest())
print('SHA1((SHA1 SALT)(SHA1 PASS)): '+m3.hexdigest())