I create a zip file with rockyou password and I tried to extractall files. But I got some issues. Doesn't matter how password I put in extractall always I will get:
('Bad password for file', <zipfile.ZipInfo object at 0x7f7928d14dc8>)
Code:
import zipfile
zfile = zipfile.ZipFile("./rockyou.zip")
pss = b"rockyou"
try:
zfile.extractall(pwd = pss)
except RuntimeError as e:
print(e)
zfile.close()
If I pass a string I got another issue:
TypeError: pwd: expected bytes, got <class 'str'>
And I tried too:
pss = str.encode("rockyou")
And:
pss = bytes(str.encode("rockyou"))
And:
pss = bytes("rockyou".encode("UTF-8"))
Well, I found a way to fix that, works for me, may not so beautiful...
zFile.extractall(pwd = 'PASSWORD'.encode('cp850','replace'))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With