I have a zip archive that is password protected in linux(the password is "secret"). However, whenever I try to open the zip file I am not prompted for a password or anything. I also have a python script that extracts zip archives and purposely passes an incorrect password and it still unzips the archive anyway. I am not running as root either as I heard root likes to ignore file permissions. Is there anything I am doing wrong?
I zipped my folder "evil" into a zip file "evil.zip" and gave it a password by using the command:
zip --pasword secret -r evil.zip evil
The python script unzip.py reads:
import zipfile zFile = zipfile.ZipFile("evil.zip") zFile.extractall(pwd="oranges")
I am running Kali Linux 1.0.9 and Zip (v. 3.0)
I also tried to use the encrypt command instead of password:
zip --encrypt -r evil.zip evil
That prompted me for a password at which I set it to secret.
I ended up with the message:
Traceback (mostrecent call last) : File "unzip.py", line 3, in <module> zFile.extractall(pwd="oranges") File "/usr/lib/python2.7/unzip.py", line 980, in extractall self.extract(zipinfo, path, pwd) File "/usr/lib/python2.7/unzip.py", line 968, in extract return self._extract_member(member, path, pwd) File "/usr/lib/python2.7/unzip.py", line 1011, in _extract_member source = self.open(member, pwd=pwd) File "/usr/lib/python2.7/unzip.py", line 952, in open raise RuntimeError("Bad password for file", name) RuntimeError: ('Bad password for file', <zipfile.ZipInfo object at 0x23a0118>)
And then the folder still unzips.