I have a dictionary with 10 words (one IS the correct password)
script on python3 (on Raspberry) iterates over dictionary
when it gets to the right password , pauses/stops (extracts the zip file) but resumes the script and does not exit nor it print "password is.."
#!/usr/bin/env python3
import zipfile
import sys
def crackzip(el_zip, clave):
try:
el_zip.extractall(pwd = clave)
sys.exit("password is : " + clave)
except:
pass
file_zip = 'file_to_crack.zip'
dictionary = 'dictionary.txt'
zippy = zipfile.ZipFile(file_zip)
with open(dictionary, 'r') as f:
for line in f.readlines():
password = line.strip('\n')
print(password)
crackzip(zippy, password.encode('utf-8'))