Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This Python file uses the following encoding: utf-8
- import sys, string, crypt
- import passlib.hash
- passwords = []
- with open('.htpasswd', 'r') as pass_file:
- for line in pass_file:
- line = line.strip('\n')
- password_to_hack = line.split(':')[1]
- block = line.split('$')
- salthash = block[2]
- #username = (block[0])[:len(block[0])-1]
- #alg = block[1]
- #hash_pass = block[3]
- #print('username = ' + username + ' alg = ' + alg + ' salthash = ' + salthash + ' hash_pass = ' + hash_pass)
- chars = string.ascii_letters
- for a in chars:
- for b in chars:
- for c in chars:
- trial = a+b+c
- crypted = passlib.hash.apr_md5_crypt.encrypt(trial,salt=salthash)
- if crypted == password_to_hack:
- break
- if crypted == password_to_hack:
- break
- if crypted == password_to_hack:
- break
- if crypted == password_to_hack:
- print( "Hasło złamane: " + trial)
- else:
- print( "Nie złamano hasła" )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement