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"))