Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import itertools as it
- import string
- from passlib.hash import sha512_crypt
- import multiprocessing
- from multiprocessing import Pool
- enc_pas = '$6$XPmWkpus$jZiSDOKdMMRZQhaCLULUO9baoau4D3Vot7tKNFqJQkStExZp9afA9rHnZ6iih8khjfkZLUbgKWIvIKQUKr7dL1'
- # create the list of used characters
- in_list = list(string.ascii_lowercase)
- in_list += ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
- in_list += ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')']
- # function to encrypt(sha512) a possible password and verify if it matches the real one
- def try_pass(s):
- dec_pas = ">>>:::sec20f:::<<<" + "".join(s) + "@x(h"
- res = sha512_crypt.using(rounds=5000, salt="XPmWkpus").verify(dec_pas, enc_pas)
- if(res):
- print(dec_pas)
- return dec_pas
- else:
- return None
- if __name__ == '__main__':
- # create processes that each run the try_pass() function
- with Pool(processes=multiprocessing.cpu_count()) as pool:
- # create a generator that that gives a character combination to the trypass() function
- for i in pool.imap_unordered(try_pass, it.product(in_list, repeat=5)):
- if i:
- with open("cracked_pass.txt", "w") as file:
- file.write(i)
- quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement