-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmd5crack.py
More file actions
21 lines (18 loc) · 779 Bytes
/
md5crack.py
File metadata and controls
21 lines (18 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import hashlib
import argparse
parser = argparse.ArgumentParser(description="MD5 Cracker")
parser.add_argument("-md5", dest="hash", help="md5 hash", required=True)
parser.add_argument("-w", dest="wordlist", help="wordlist", required=True)
parsed_args = parser.parse_args()
def main():
hash_cracked = ""
with open(parsed_args.wordlist) as file:
for line in file:
line = line.strip()
if hashlib.md5(bytes(line,encoding="utf-8")).hexdigest() == parsed_args.hash:
hash_cracked = line
print("\nMD5-hash has been successfully cracked. The value is %s."%line)
if hash_cracked == "":
print("\nFailed to crack the hash. Try using a bigger/different dictionary.")
if __name__ == "__main__":
main()