Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #coding: utf-8
- import zipfile
- alphabet = [chr(i) for i in range(ord('a'), ord('z') + 1)]
- for i in range(10):
- alphabet.append(str(i))
- def brute_crack_zip(file):
- z = zipfile.ZipFile(file, 'r')
- def next_pwd(p = ''):
- for alpha in alphabet:
- new_p = p + alpha
- try:
- z.extractall(pwd=new_p)
- return p
- except Exception as e:
- pass
- if len(new_p) < 8:
- next_pwd(new_p)
- res = next_pwd()
- if type(res) == 'str':
- z.close()
- return res
- z.close()
- return 'not found'
Add Comment
Please, Sign In to add comment