zip
解压出很多zip文件,但是大小很小,跑弱口令也跑不出来
利用crc爆破data,然后像他题目描述的那样拼接数据即可
#python3
import zipfile
import string
import binascii
def CrackCrc(crc):
for i in dic:
for j in dic:
for k in dic:
for h in dic:
s = i + j + k + h
if crc == (binascii.crc32(s.encode())):
f.write(s)
return
def CrackZip():
for i in range(0,68):
file = 'out'+str(i)+'.zip'
crc = zipfile.ZipFile(file,'r').getinfo('data.txt').CRC
CrackCrc(crc)
print('\r'+"loading:{:%}".format(float((i+1)/68)),end='')
dic = string.ascii_letters + string.digits + '+/='
f = open('out.txt','w')
print("\nCRC32begin")
CrackZip()
print("CRC32finished")
f.close()
爆破完之后,发现数据很奇怪,对比尾部特征发现是缺失头部的rar文件
补齐rar文件头,解压得到flag
what flag竟然不在里面
查看rar压缩包注释,得flag
rar v 1.rar
flag{nev3r_enc0de_t00_sm4ll_fil3_w1th_zip}