Just a blog to share my tricks, code snippets

Showing posts with label zipfile. Show all posts
Showing posts with label zipfile. Show all posts

Friday, September 22, 2017

Write a simple zip file password cracker with Python


In order to extract a zip file, Python provides a zipfile library which help us create, read write, append and list a zip file. However, It only supports ZipCrypto encryption. A complete guide about it is HERE

So the idea is:
- Read a file pw.txt that contains all passwords.
- Try to extract the file for each password
Here is the script:

Note: The zipfile library only support ZipCrypto encryption. That means when you use 7zip to archive a file, remember to use the ZipCrypto encryption method instead of AES-256 one