祥云杯2021 writeup

Misc

鸣雏恋

解压得到docx文件,改为zip,在_rels文件夹下发现key.txt,零宽字节解密得密码Because I like naruto best


解压得图片,只有两种图,转二进制

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python3
import os
from alive_progress import alive_bar
import threading

data = ''

total=129487

#进度条
for x in range(total,total+1):
with alive_bar(x) as bar:

#将图片转化为2进制
for i in range(0,total+1):
filename = str(i)+ ".png"
#最初想的是调用os,md5判断,速度较慢,需要十几分钟
'''
a = os.popen("md5 "+str(i)+".png")
md5 = a.read()[-32:]
if '29b9b5c770a188849b787047c7d994d' in md5:
result = '0'
elif '4e828cce80ef24b02c48310a697f97c' in md5:
result = '1'
'''

#直接读取图片二进制判断01,几十秒
with open(filename, 'rb') as f:
dataa = f.read()
#print(dataa[19:20])
if dataa[19:20] == b'\x17':
result = '0'
elif dataa[19:20] == b'\x1b':
result = '1'
data += str(result)

#输出进度条
bar()

file=open('datanew.txt','w')
file.write(str(data));
file.close()

二进制转ascii,base64解码得flag图片