我正在尝试做这项作业https://www.root-me.org/en/Challenges/Cryptanalysis/File-PKZIP当我编写一个函数来破解它时。
import subprocess from time import sleep
file = open('/home/begood/Downloads/SecLists-master/Passwords/'
'rockyou-75.txt', 'r') lines = file.readlines() file.close() for line in lines:
command = 'unzip -P ' + line.strip() + ' /home/begood/Downloads/ch5.zip'
print command
p = subprocess.Popen(
command,
stdout=subprocess.PIPE, shell=True).communicate()[0]
if 'replace' in p:
print 'y\n'
sleep(1)
它停在密码= scooter
:
unzip -P scooter /home/begood/Downloads/ch5.zip replace readme.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename:
但是当我用它解压缩时它说:
inflating: /home/begood/readme.txt
error: invalid compressed data to inflate
它真正的密码是:14535
。为什么pkzip接受两个密码?