Session 03 - Python for Forensics
The code here is to support the Session 03 lecture.
passwordCrackZipSimple.py
import zipfile
from threading import Thread
def extract_zip(zFile, password):
try:
zFile.extractall(pwd=password.encode('utf-8'))
print("[+] Password Found: " + password + "\n")
except Exception as e:
pass
def main():
zFilename = 'Images.zip'
dictionary = 'dictionary.txt'
zFile = zipfile.ZipFile(zFilename)
with open(dictionary, 'r') as f:
for line in f.readlines():
password = line.strip('\n')
try:
zFile.extractall(pwd=password.encode('utf-8'))
print('Password Found: %s' % password)
except Exception as e:
pass
if __name__ == '__main__':
main()