Python Forum
Archive (.7z, .zip, .rar, .tar, etc) Password Extractor - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Archive (.7z, .zip, .rar, .tar, etc) Password Extractor (/thread-11429.html)



Archive (.7z, .zip, .rar, .tar, etc) Password Extractor - btforensics - Jul-08-2018

Hi Everyone,

I'm just new to Python. I've already learned the basics by watching videos online.

I am planning to write a script that will automatically extract password protected archives such as 7z, zip, rar, tar, etc.

What I want to happened is when I do a right click on that archive (Windows Machine), there will be an option to select to call my script to extract the archive and extract it using predefined passwords. For example, the passwords that I want to use to automatically extract the archive are the following - "1234", "password", "admin".

This is the only code that I have so far.
import zipfile
zf = zipfile.ZipFile('data.zip')
print zf.namelist()
from zipfile import ZipFile
with ZipFile('data.zip') as zf:
    zf.extractall(pwd='password')
Thank you for your help!


RE: Archive (.7z, .zip, .rar, .tar, etc) Password Extractor - Larz60+ - Jul-08-2018

see package: https://pypi.org/project/password/