-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhash_cracker.py
More file actions
51 lines (44 loc) · 1.74 KB
/
hash_cracker.py
File metadata and controls
51 lines (44 loc) · 1.74 KB
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
import hashlib
import sys
import pyfiglet
ascii_banner = pyfiglet.figlet_format("HashBat")
print(ascii_banner)
print("Available Algorithms: MD5 | SHA1 | SHA224 | SHA256 | SHA512 | SHA384")
hash_type = str(input("What's the hash type? "))
wordlist_location = str(input("Wordlist location: "))
hash = str(input("Enter hash: "))
word_list = open(f"{wordlist_location}").read()
list = word_list.splitlines()
for word in list:
if hash_type == "MD5":
hash_object = hashlib.md5(f"{word}".encode('utf-8'))
hashed = hash_object.hexdiges()
if hash == hashed:
print(f"\033[1;32m HASH FOUND: {word} \n")
elif hash_type =="SHA1":
hash_object = hashlib.sha1(f"{word}".encode('utf-8'))
hashed = hash_object.hexdiges()
if hash == hashed:
print(f"\033[1;32m HASH FOUND: {word} \n")
elif hash_type =="SHA224":
hash_object = hashlib.sha224(f"{word}".encode('utf-8'))
hashed = hash_object.hexdiges()
if hash == hashed:
print(f"\033[1;32m HASH FOUND: {word} \n")
elif hash_type =="SHA256":
hash_object = hashlib.sha256(f"{word}".encode('utf-8'))
hashed = hash_object.hexdiges()
if hash == hashed:
print(f"\033[1;32m HASH FOUND: {word} \n")
elif hash_type =="SHA512":
hash_object = hashlib.sha512(f"{word}".encode('utf-8'))
hashed = hash_object.hexdiges()
if hash == hashed:
print(f"\033[1;32m HASH FOUND: {word} \n")
elif hash_type =="SHA384":
hash_object = hashlib.sha384(f"{word}".encode('utf-8'))
hashed = hash_object.hexdiges()
if hash == hashed:
print(f"\033[1;32m HASH FOUND: {word} \n")
else:
print("Please choose from given options.")