1.下载解压得到大量文本文件,打开其中一个发现后面跟着下一个文本文件名,似乎是排序作用。找到排在第一位的文本打开,文本首部20555转16进制为504b,第二位文本首部字符串为772,十六进制为0304。504B 0304为zip压缩包文件头部标识
2.使用脚本,提取每个txt文本开头数字,生成zip文件
import re
current_path = ".\\files\\"
start = open(current_path + "start.txt","r")
zipfile = open(".\\1.zip","wb")
content = start.read()
while True:
num = re.findall(r"^[0-9]+",content)[0]
zipfile.write((int(num)).to_bytes(2, byteorder = 'big'))
filename = re.findall(r" ([A-Za-z0-9.]+)$",content)
if filename:
nextfile = open(current_path + filename[0],"r")
content = nextfile.read()
nextfile.close()
else:
break
print(content)
start.close()
zipfile.close()
3.打开发现压缩包有密码
4.使用压缩包爆破工具爆破,这里为数字、小写字母混合六位密码
5.解压后得到图片打不开,使用010 Editor打开,发现尾部标识为FFD9,将文件头部标识修改为FFD9 FFE0保存
6.图片中写有flag