Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hashlib
- import time
- hash_type = input("Enter the hash type\n1 md5\n2 sha1\n3 NTLM\n")
- path_to_wordlist = input("Enter path to word list\n")
- input_hash = input("Enter the hash t crack\n")
- def md5_crack(hash_to_crack,path_to_wordlist):
- global c
- c = 1
- with open(path_to_wordlist,encoding='utf-8') as file1:
- for line in file1:
- current_pass = line.replace('\n','').rstrip()
- hash_current = hashlib.md5(current_pass.encode('utf-8')).hexdigest()
- c += 1
- if c%100000 == 0:
- print(f"Done {c} passwords current ---> {current_pass}")
- if hash_current == hash_to_crack:
- print(f"Password found ---> {current_pass}")
- break
- def sha1_crack(hash_to_crack,path_to_wordlist):
- c = 1
- with open(path_to_wordlist,encoding='utf-8') as file1:
- for line in file1:
- current_pass = line.replace('\n','').rstrip()
- hash_current = hashlib.sha1(current_pass.encode('utf-8')).hexdigest()
- c += 1
- if c%100000 == 0:
- print(f"Done {c} passwords current ---> {current_pass}")
- if hash_current == hash_to_crack:
- print(f"Password found ---> {current_pass}")
- break
- def ntlm_crack(hash_to_crack,path_to_wordlist):
- c = 1
- with open(path_to_wordlist,encoding='utf-8') as file1:
- for line in file1:
- current_pass = line.replace('\n','').rstrip()
- hash_current = hashlib.new('md4',current_pass.encode('utf-16le')).hexdigest()
- c += 1
- if c%100000 == 0:
- print(f"Done {c} passwords current ---> {current_pass}")
- if hash_current == hash_to_crack:
- print(f"Password found ---> {current_pass}")
- break
- if hash_type == "1":
- time1 = time.time()
- md5_crack(input_hash,path_to_wordlist)
- time2 = time.time()
- diff = time2-time1
- wps = float(c)/float(diff)
- print(f"time taken:{diff} {wps} w/s")
- elif hash_type == "2":
- sha1_crack(input_hash,path_to_wordlist)
- elif hash_type == "3":
- ntlm_crack(input_hash.lower(),path_to_wordlist)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement