-
Notifications
You must be signed in to change notification settings - Fork 0
/
HashPUP.py
542 lines (378 loc) · 13.8 KB
/
HashPUP.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
import pyfiglet
from halo import Halo
import hashlib
import time,os,sys
import time
import requests
from colorama import init
from colorama import Fore, Back, Style
init()
import itertools as t
from termcolor import colored, cprint
os.system("clear")
print(pyfiglet.figlet_format('Hash PUP',justify="center",font="doom"))
cprint("""
CODED BY:berry-dev
GitHub: https://github.com/berry-dev/
""","blue",attrs=["bold"])
input("Press enter to continue: ")
os.system("clear")
print(Fore.LIGHTYELLOW_EX+"""
[-] What do you want to do? [-]
1. Decrypt hashes into plain text
2. Generate a wordlist
3. Identify hashes
4. Help
""")
selection=int(input("Enter: " ))
if selection == 1:
def menu():
print("""
(+)Select one hashing algorithm(+)
1. md5 6. SHA224 11. sha3_224
2. SHA1 7. blake2b 12. sha3_256
3. SHA256 8. blake2s 13. sha3_384
4. SHA384 9. shake_128 14. sha3_512
5. SHA512 10. shake_256 15. scrypt
""")
menu()
print("\n")
selection=int(input("Enter: " ))
flag = 0
print ("\n")
if selection == 1:
cprint("md5 is now selected",'white')
print ("\n")
pass_hash = input(Fore.CYAN+"ENTER MD5 HASH: ")
wordlist = input("ENTER NAME OF THE FILE: ")
try:
pass_file = open (wordlist, "r")
except:
cprint("CANNOT FIND THE FILE!! YOUR FILE SHOULD BE IN THE SAME DIRECTORY THAT YOU ARE RUNNING THIS PYTHON SCRIPT",'red')
quit()
for word in pass_file:
enc_wrd = word.encode('utf-8')
digest = hashlib.md5(enc_wrd.strip()).hexdigest()
if digest == pass_hash:
print("Your Password is",)
cprint(word)
flag = 1
break
if flag ==0:
cprint("password not found );")
if selection == 2:
cprint("sha1 is now selected",'white')
print("\n")
pass_hash = input(Fore.CYAN+"ENTER sha1 HASH: ")
wordlist = input("ENTER NAME OF THE FILE: ")
try:
pass_file = open (wordlist, "r")
except:
cprint("CANNOT FIND THE FILE!! YOUR FILE SHOULD BE IN THE SAME DIRECTORY THAT YOU ARE RUNNING THIS PYTHON SCRIPT",'red')
quit()
for word in pass_file:
enc_wrd = word.encode('utf-8')
digest = hashlib.sha1(enc_wrd.strip()).hexdigest()
if digest == pass_hash:
print("Your Password is",)
cprint(word)
flag = 1
break
if flag ==0:
cprint("password not found );")
if selection == 3:
cprint("sha256 is now selected")
print("\n")
pass_hash = input(Fore.CYAN+"ENTER sha256 HASH: ")
wordlist = input("ENTER NAME OF THE FILE: ")
try:
pass_file = open (wordlist, "r")
except:
cprint("CANNOT FIND THE FILE!! YOUR FILE SHOULD BE IN THE SAME DIRECTORY THAT YOU ARE RUNNING THIS PYTHON SCRIPT",'red')
quit()
for word in pass_file:
enc_wrd = word.encode('utf-8')
digest = hashlib.sha256(enc_wrd.strip()).hexdigest()
if digest == pass_hash:
print("Your Password is",)
cprint(word)
flag = 1
break
if flag ==0:
cprint("password not found );")
if selection == 4:
cprint("sha384 is now selected")
print("\n")
pass_hash = input(Fore.CYAN+"ENTER sha384 HASH: ")
wordlist = input("ENTER NAME OF THE FILE: ")
try:
pass_file = open (wordlist, "r")
except:
cprint("CANNOT FIND THE FILE!! YOUR FILE SHOULD BE IN THE SAME DIRECTORY THAT YOU ARE RUNNING THIS PYTHON SCRIPT",'red')
quit()
for word in pass_file:
enc_wrd = word.encode('utf-8')
digest = hashlib.sha384(enc_wrd.strip()).hexdigest()
if digest == pass_hash:
print("Your Password is",)
cprint(word)
flag = 1
break
if flag ==0:
cprint("password not found );")
if selection == 5:
cprint("sha512 is now selected")
print("\n")
pass_hash = input(Fore.CYAN+"ENTER sha512 HASH: ")
wordlist = input("ENTER NAME OF THE FILE: ")
try:
pass_file = open (wordlist, "r")
except:
cprint("CANNOT FIND THE FILE!! YOUR FILE SHOULD BE IN THE SAME DIRECTORY THAT YOU ARE RUNNING THIS PYTHON SCRIPT",'red')
quit()
for word in pass_file:
enc_wrd = word.encode('utf-8')
digest = hashlib.sha512(enc_wrd.strip()).hexdigest()
if digest == pass_hash:
print("Your Password is",)
cprint(word)
flag = 1
break
if flag ==0:
cprint("password not found );")
if selection == 6:
cprint("sha224 is now selected")
print("\n")
pass_hash = input(Fore.CYAN+"ENTER sha224 HASH: ")
wordlist = input("ENTER NAME OF THE FILE: ")
try:
pass_file = open (wordlist, "r")
except:
cprint("CANNOT FIND THE FILE!! YOUR FILE SHOULD BE IN THE SAME DIRECTORY THAT YOU ARE RUNNING THIS PYTHON SCRIPT",'red')
quit()
for word in pass_file:
enc_wrd = word.encode('utf-8')
digest = hashlib.sha224(enc_wrd.strip()).hexdigest()
if digest == pass_hash:
print("Your Password is",)
cprint(word)
flag = 1
break
if flag ==0:
cprint("password not found );")
if selection == 7:
cprint("blake2b is now selected")
print("\n")
pass_hash = input(Fore.CYAN+"ENTER blake2b HASH: ")
wordlist = input("ENTER NAME OF THE FILE: ")
try:
pass_file = open (wordlist, "r")
except:
cprint("CANNOT FIND THE FILE!! YOUR FILE SHOULD BE IN THE SAME DIRECTORY THAT YOU ARE RUNNING THIS PYTHON SCRIPT",'red')
quit()
for word in pass_file:
enc_wrd = word.encode('utf-8')
digest = hashlib.blake2b(enc_wrd.strip()).hexdigest()
if digest == pass_hash:
print("Your Password is",)
cprint(word)
flag = 1
break
if flag ==0:
cprint("password not found );")
if selection == 8:
cprint("blake2s is now selected")
print("\n")
pass_hash = input(Fore.CYAN+"ENTER blake2s HASH: ")
wordlist = input("ENTER NAME OF THE FILE: ")
try:
pass_file = open (wordlist, "r")
except:
cprint("CANNOT FIND THE FILE!! YOUR FILE SHOULD BE IN THE SAME DIRECTORY THAT YOU ARE RUNNING THIS PYTHON SCRIPT",'red')
quit()
for word in pass_file:
enc_wrd = word.encode('utf-8')
digest = hashlib.blake2s(enc_wrd.strip()).hexdigest()
if digest == pass_hash:
print("Your Password is",)
cprint(word)
flag = 1
break
if flag ==0:
cprint("password not found );")
if selection == 9:
cprint("shake_128 is now selected")
print("\n")
pass_hash = input(Fore.CYAN+"ENTER shake_128 HASH: ")
wordlist = input("ENTER NAME OF THE FILE: ")
try:
pass_file = open (wordlist, "r")
except:
cprint("CANNOT FIND THE FILE!! YOUR FILE SHOULD BE IN THE SAME DIRECTORY THAT YOU ARE RUNNING THIS PYTHON SCRIPT",'red')
quit()
for word in pass_file:
enc_wrd = word.encode('utf-8')
digest = hashlib.shake_128(enc_wrd.strip()).hexdigest()
if digest == pass_hash:
print("Your Password is",)
cprint(word)
flag = 1
break
if flag ==0:
cprint("password not found );")
if selection == 10:
cprint("shake_256 is now selected")
print("\n")
pass_hash = input(Fore.CYAN+"ENTER shake_256 HASH: ")
wordlist = input("ENTER NAME OF THE FILE: ")
try:
pass_file = open (wordlist, "r")
except:
cprint("CANNOT FIND THE FILE!! YOUR FILE SHOULD BE IN THE SAME DIRECTORY THAT YOU ARE RUNNING THIS PYTHON SCRIPT",'red')
quit()
for word in pass_file:
enc_wrd = word.encode('utf-8')
digest = hashlib.shake_256(enc_wrd.strip()).hexdigest()
if digest == pass_hash:
print("Your Password is",)
cprint(word)
flag = 1
break
if flag ==0:
cprint("password not found );")
if selection == 11:
cprint("sha3_224 is now selected")
print("\n")
pass_hash = input(Fore.CYAN+"ENTER sha3_224 HASH: ")
wordlist = input("ENTER NAME OF THE FILE: ")
try:
pass_file = open (wordlist, "r")
except:
cprint("CANNOT FIND THE FILE!! YOUR FILE SHOULD BE IN THE SAME DIRECTORY THAT YOU ARE RUNNING THIS PYTHON SCRIPT",'red')
quit()
for word in pass_file:
enc_wrd = word.encode('utf-8')
digest = hashlib.sha3_224(enc_wrd.strip()).hexdigest()
if digest == pass_hash:
print("Your Password is",)
cprint(word)
flag = 1
break
if flag ==0:
cprint("password not found );")
if selection == 12:
cprint("sha3_256 is now selected")
print("\n")
pass_hash = input(Fore.CYAN+"ENTER sha3_256 HASH: ")
wordlist = input("ENTER NAME OF THE FILE: ")
try:
pass_file = open (wordlist, "r")
except:
cprint("CANNOT FIND THE FILE!! YOUR FILE SHOULD BE IN THE SAME DIRECTORY THAT YOU ARE RUNNING THIS PYTHON SCRIPT",'red')
quit()
for word in pass_file:
enc_wrd = word.encode('utf-8')
digest = hashlib.sha3_256(enc_wrd.strip()).hexdigest()
if digest == pass_hash:
print("Your Password is",)
cprint(word)
flag = 1
break
if flag ==0:
cprint("password not found );")
if selection == 13:
cprint("sha3_384 is now selected")
print("\n")
pass_hash = input(Fore.CYAN+"ENTER sha3_384 HASH: ")
wordlist = input("ENTER NAME OF THE FILE: ")
try:
pass_file = open (wordlist, "r")
except:
cprint("CANNOT FIND THE FILE!! YOUR FILE SHOULD BE IN THE SAME DIRECTORY THAT YOU ARE RUNNING THIS PYTHON SCRIPT",'red')
quit()
for word in pass_file:
enc_wrd = word.encode('utf-8')
digest = hashlib.sha3_384(enc_wrd.strip()).hexdigest()
if digest == pass_hash:
print("Your Password is",)
cprint(word)
flag = 1
break
if flag ==0:
cprint("password not found );")
if selection == 14:
cprint("sha3_512 is now selected")
print("\n")
pass_hash = input(Fore.CYAN+"ENTER sha3_512 HASH: ")
wordlist = input("ENTER NAME OF THE FILE: ")
try:
pass_file = open (wordlist, "r")
except:
cprint("CANNOT FIND THE FILE!! YOUR FILE SHOULD BE IN THE SAME DIRECTORY THAT YOU ARE RUNNING THIS PYTHON SCRIPT",'red')
quit()
for word in pass_file:
enc_wrd = word.encode('utf-8')
digest = hashlib.sha3_512(enc_wrd.strip()).hexdigest()
if digest == pass_hash:
print("Your Password is",)
cprint(word)
flag = 1
break
if flag ==0:
cprint("password not found );")
if selection == 15:
cprint("scrypt is now selected")
print("\n")
pass_hash = input(Fore.CYAN+"ENTER scrypt HASH: ")
wordlist = input("ENTER NAME OF THE FILE: ")
try:
pass_file = open (wordlist, "r")
except:
cprint("CANNOT FIND THE FILE!! YOUR FILE SHOULD BE IN THE SAME DIRECTORY THAT YOU ARE RUNNING THIS PYTHON SCRIPT",'red')
quit()
for word in pass_file:
enc_wrd = word.encode('utf-8')
digest = hashlib.scrypt(enc_wrd.strip()).hexdigest()
if digest == pass_hash:
print("Your Password is",)
cprint(word)
flag = 1
break
if flag ==0:
cprint("password not found );")
elif selection == 2:
min = int(input(Fore.CYAN+"\n""Enter minimum length: "))
max = int(input("Enter maximum length: "))
chars = input(Fore.YELLOW+"\n""Enter the magical word: ")
output = input("Enter the new file name: ")
if output == "" or output is None:
file = open(chars+".txt", "w")
else:
file = open(output, "w")
if min == max:
for a in t.product(chars, repeat= min):
s = "".join(a)
file.write(s+"\n")
file.close()
elif min < max:
for i in range(min, max + 1):
for a in t.product(chars, repeat= i):
s ="".join(a)
file.write(s+"\n")
file.close()
print("\n""wordlist created without any error")
else:
quit()
elif selection == 3:
print("under maintenance")
elif selection == 4:
print("\n" """
($) Hashpup uses hashlib to crack hashes to plain text, currently there are 15 algorithms (popular ones)
($) To get the plain text u need to enter the hash and wordlist. if the wordlist contains the hash password
($) then it will say the password but if it doesn't then it will show "Password not found"
($) If you are facing problems entering the wordlist then your wordlist must be in the same directory as you
($) are running this script only enter the name of .txt file (dont specify the path).
($) For generating a wordlist dont enter too much of words it can kill your pc press CTRL+C to stop it the
output file will be in the same directory you are running this script.
--THANK YOU FOR READING FOLLOW MY GITHUB TO KNOW MORE --
""")