NSSCTF Round#23 Misc个人专项赛WP

画师

flag为有意义单词
flag{[a-zA-Z_]}

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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
<mxfile host="app.diagrams.net" modified="2024-04-22T09:08:59.622Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0" etag="MTy_pS9izUer-qoD0v4x" version="24.2.5" type="device">
<diagram name="第 1 页" id="zEMwM2VCor-ZNyr7IRSY">
<mxGraphModel dx="1321" dy="760" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="KFWuwmgogRQ2IQqMv47f-1" value="" style="shape=curlyBracket;whiteSpace=wrap;html=1;rounded=1;labelPosition=left;verticalLabelPosition=middle;align=right;verticalAlign=middle;textOpacity=0;strokeColor=#FFFFFF;direction=east;flipV=1;opacity=0;" parent="1" vertex="1">
<mxGeometry x="540" y="30" width="20" height="180" as="geometry" />
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-2" value="" style="endArrow=none;dashed=1;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="40" y="121" as="sourcePoint" />
<mxPoint x="120" y="121" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-3" value="" style="edgeStyle=entityRelationEdgeStyle;fontSize=12;html=1;endArrow=ERone;endFill=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="100" height="100" relative="1" as="geometry">
<mxPoint x="30" y="50" as="sourcePoint" />
<mxPoint x="140" y="170" as="targetPoint" />
<Array as="points">
<mxPoint x="120" y="170" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-4" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="170" y="160" as="sourcePoint" />
<mxPoint x="210" y="50" as="targetPoint" />
<Array as="points">
<mxPoint x="180" y="50" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-5" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="250" y="100" as="sourcePoint" />
<mxPoint x="310" y="100" as="targetPoint" />
<Array as="points">
<mxPoint x="280" y="160" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-7" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="250" y="161" as="sourcePoint" />
<mxPoint x="360" y="161" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-8" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="414" y="100" as="sourcePoint" />
<mxPoint x="464" y="150" as="targetPoint" />
<Array as="points">
<mxPoint x="414" y="130" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-9" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="410" y="100" as="sourcePoint" />
<mxPoint x="460" y="200" as="targetPoint" />
<Array as="points">
<mxPoint x="470" y="100" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-10" value="" style="endArrow=none;dashed=1;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="414" y="151" as="sourcePoint" />
<mxPoint x="460" y="151" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-11" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="630" y="330" as="sourcePoint" />
<mxPoint x="690" y="330" as="targetPoint" />
<Array as="points">
<mxPoint x="660" y="390" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-12" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="640" y="391" as="sourcePoint" />
<mxPoint x="740" y="391" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-19" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="610" y="140" as="sourcePoint" />
<mxPoint x="660" y="110" as="targetPoint" />
<Array as="points">
<mxPoint x="660" y="120" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-20" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="670" y="140" as="sourcePoint" />
<mxPoint x="610" y="170" as="targetPoint" />
<Array as="points">
<mxPoint x="610" y="140" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-21" value="" style="edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="610" y="140" as="sourcePoint" />
<mxPoint x="670" y="110" as="targetPoint" />
<Array as="points">
<mxPoint x="610" y="110" />
<mxPoint x="610" y="110" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-22" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="210" y="500" as="sourcePoint" />
<mxPoint x="270" y="565" as="targetPoint" />
<Array as="points">
<mxPoint x="230" y="610" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-28" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="470" y="380" as="sourcePoint" />
<mxPoint x="410" y="330" as="targetPoint" />
<Array as="points">
<mxPoint x="440" y="270" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-29" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="470" y="331" as="sourcePoint" />
<mxPoint x="400" y="331" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-35" value="" style="endArrow=none;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="250" y="371" as="sourcePoint" />
<mxPoint x="320" y="371" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-36" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="710" y="110" as="sourcePoint" />
<mxPoint x="770" y="110" as="targetPoint" />
<Array as="points">
<mxPoint x="740" y="170" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-37" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="720" y="171" as="sourcePoint" />
<mxPoint x="820" y="171" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-38" value="" style="curved=1;endArrow=classic;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="50" y="290" as="sourcePoint" />
<mxPoint x="100" y="340" as="targetPoint" />
<Array as="points">
<mxPoint x="100" y="290" />
<mxPoint x="50" y="340" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-40" value="" style="endArrow=none;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="140" y="330" as="sourcePoint" />
<mxPoint x="170" y="300" as="targetPoint" />
<Array as="points" />
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-41" value="" style="endArrow=classic;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="200" y="380" as="sourcePoint" />
<mxPoint x="140" y="300" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-50" value="" style="endArrow=none;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="549.5" y="330" as="sourcePoint" />
<mxPoint x="549.5" y="390" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-55" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="84" y="500" as="sourcePoint" />
<mxPoint x="134" y="550" as="targetPoint" />
<Array as="points">
<mxPoint x="84" y="530" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-56" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="80" y="500" as="sourcePoint" />
<mxPoint x="130" y="600" as="targetPoint" />
<Array as="points">
<mxPoint x="140" y="500" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-57" value="" style="endArrow=none;dashed=1;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="84" y="551" as="sourcePoint" />
<mxPoint x="130" y="551" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-58" value="" style="edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="350" y="509" as="sourcePoint" />
<mxPoint x="410" y="509" as="targetPoint" />
<Array as="points">
<mxPoint x="380" y="569" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-59" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="360" y="570" as="sourcePoint" />
<mxPoint x="460" y="570" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-60" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="520" y="579.5" as="sourcePoint" />
<mxPoint x="550" y="509.5" as="targetPoint" />
<Array as="points">
<mxPoint x="550" y="499.5" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-61" value="" style="edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="550" y="579.5" as="sourcePoint" />
<mxPoint x="580" y="509.5" as="targetPoint" />
<Array as="points">
<mxPoint x="580" y="499.5" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-63" value="" style="shape=waypoint;sketch=0;fillStyle=solid;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;textOpacity=0;strokeColor=#FFFFFF;flipV=1;opacity=0;" parent="1" vertex="1">
<mxGeometry x="540" y="300" width="20" height="20" as="geometry" />
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-64" value="" style="endArrow=classic;html=1;rounded=0;textOpacity=0;strokeColor=#FFFFFF;opacity=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="520" y="579.5" as="sourcePoint" />
<mxPoint x="520" y="509.5" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="KFWuwmgogRQ2IQqMv47f-65" value="" style="shape=curlyBracket;whiteSpace=wrap;html=1;rounded=1;flipH=1;labelPosition=right;verticalLabelPosition=middle;align=left;verticalAlign=middle;textOpacity=0;strokeColor=#FFFFFF;direction=east;flipV=1;opacity=0;" parent="1" vertex="1">
<mxGeometry x="670" y="440" width="20" height="220" as="geometry" />
</mxCell>
<mxCell id="wNboY0RjY8ZMtIGdafHw-1" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="280" y="240" width="120" height="60" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

image-20240428134947291

将透明度改为100%

image-20240502105906861

以为是但是和flag{有点区别

垂直翻转一下

image-20240502110051668

flag{easy_diagram}

easy_signin1

绝对的misc 由此而生的签到
教会ctfer们flag的是……

hint: image to 01 然后找一下2.png相对于1.png不同的地方

取黑白为二进制,对比差异

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
from PIL import Image

img1 = Image.open("1.png")
img2 = Image.open("2.png")

img1s = ''
img2s = ''

for i in img1.getdata():
if i == (255,255,255,255):
img1s += '0'
else:
img1s += '1'
for i in img2.getdata():
if i == (255,255,255,255):
img2s += '0'
else:
img2s += '1'
code = ''
for i in range(len(img1s)):
if img1s[i] != img2s[i]:
code += img2s[i]
with open('enc.c','w') as fw:
for i in range(0,len(code),8):
fw.write(chr(int(code[i:i+8],2)))

或者

提示说:image to 01 然后找一下2.png相对于1.png不同的地方,一开始以为是异或,结果就是传统的找出2.png的二进制和1.png不一样的地方然后打印

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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from PIL import Image
import math
import sys

def is_black(pixel):
# 判断像素是否是黑色
# 如果红、绿、蓝通道的值都很低,则认为是黑色
return all(value < 10 for value in pixel[:3])


def is_white(pixel):
# 判断像素是否是白色
# 如果红、绿、蓝通道的值都很高,则认为是白色
return all(value > 245 for value in pixel[:3])

flag1=""
flag2=""
def scan_image(image_path):
global flag1
# 打开图像文件
image = Image.open(image_path)
# 获取图像的像素数据
pixels = image.load()
width, height = image.size

for y in range(height):
for x in range(width):
# 获取像素的RGB值
pixel = pixels[x, y]
# 判断像素是黑色还是白色
if is_black(pixel):
flag1=flag1+"1"
elif is_white(pixel):
flag1=flag1+"0"
else:
print("err")
def scan_image2(image_path):
global flag2
# 打开图像文件
image = Image.open(image_path)
# 获取图像的像素数据
pixels = image.load()
width, height = image.size

for y in range(height):
for x in range(width):
# 获取像素的RGB值
pixel = pixels[x, y]
# 判断像素是黑色还是白色
if is_black(pixel):
flag2=flag2+"1"
elif is_white(pixel):
flag2=flag2+"0"
else:
print("err")
# 调用函数扫描图像
scan_image("1.png")

scan_image2("2.png")
for i in range(len(flag1)):
if flag1[i] != flag2[i]:
print(flag2[i],end="")

得到

1
0010001101101001011011100110001101101100011101010110010001100101001111000110001001101001011101000111001100101111011100110111010001100100011000110010101100101011001011100110100000111110000010100111010101110011011010010110111001100111001000000110111001100001011011010110010101110011011100000110000101100011011001010010000001110011011101000110010000111011000010100111001101110100011100100110100101101110011001110010000001101011011001010111100100100000001111010010000000100010001000100011101100100000000010100000101001101001011011100111010000100000011011010110000101101001011011100010100000101001011110110000101000001001011100110111010001110010011010010110111001100111001000000110001101110010011110010111000001110100011011110101111101110100011110000111010000111011000010100000100101100011011010010110111000111110001111100110001101110010011110010111000001110100011011110101111101110100011110000111010000111011001000000000101000001010000010010110011001101111011100100010000000101000011010010110111001110100001000000110100100100000001111010010000000110000001110110010000001101001001000000011110000100000011000110111001001111001011100000111010001101111010111110111010001111000011101000010111001101100011001010110111001100111011101000110100000101000001010010011101100100000001010110010101101101001001010010111101100001010001000000010000000100000001000000010000000100000001000000010000001100011011010000110000101110010001000000110010101101110011000110111001001111001011100000111010001100101011001000101111101110100011110000111010000100000001111010010000001100011011010000110000101110010001010000110001101110010011110010111000001110100011011110101111101110100011110000111010001011011011010010101110100100000010111100010000001101011011001010111100101011011011010010010000000100101001000000110101101100101011110010010111001101100011001010110111001100111011101000110100000101000001010010101110100100000010111100010000001100011011100100111100101110000011101000110111101011111011101000111100001110100010110110010100001101001001000000010101100100000001100010010100100100000001001010010000001100011011100100111100101110000011101000110111101011111011101000111100001110100001011100110110001100101011011100110011101110100011010000010100000101001010111010010100100111011000010100010000000100000001000000010000000100000001000000010000000100000011000110110111101110101011101000010000000111100001111000010000001101001011011100111010000101000011001010110111001100011011100100111100101110000011101000110010101100100010111110111010001111000011101000010100100100000001111000011110000100000001000100010000000100010001110110000101000100000001000000010000000100000011111010010000000100000001000000000101000100000001000000010000000100000011100100110010101110100011101010111001001101110001000000011000000111011000010100111110100001010000010100010111100101111001000000110010101101110011000110111001001111001011100000111010001100101011001000101111101110100011110000111010000110001001000000011110100100000001100010011001000110010001011000011000100110010001101110010110000110001001100010011000100101100001100010011000100110001001011000011100100110110001011000011000100110001001101000010110000110001001100010011010100101100001100010011001000110111001011000011011100110111001011000011100100110000001011000011000100110001001110010010110000111001001100100010110000111000001110010010110000110001001100010011011100101100001100010011001000110110001011000011100000110101001011000011100000110111001011000011000100110001001101110010110000110001001100010011000100101100001100010011000100110001001011000011100000110110001011000011100000110100001011000011000100110010001100100010110000110001001100100011011100101100001100010011000100110001001011000011011100110101001011000011100000110001001011000011100100110111001011000011000100110010001100000010110000111001001101000010110000111001001100110010110000110001001100010011000000101100001110010011100000101100001101100011010100101100001110000011010000101100001100010011001000110111001011000011000100110000001101010010110000110110001110010010110000111000001101110010110000110001001100100011010100101100001110010011100000101100001100010011000000110111001011000011100000110111001011000011011100110000001011000011000100110000001110000010110000110001001100100011011100101100001110000011001100101100001110000011100000101100001100010011000000110101001011000011000100110000001101010010110000111001001110000010110000111001001101010010110000111000001110000010110000110001001100000011001000101100001110010011011000101100001100010011000100111000001011000011000100110000001101000010110000110001001100010011010000001010001011110010111100100000011001000110111001100011011100100111100101110000011101000110010101100100010111110111010001111000011101000010000000111101001000000110011001101100011000010110011101111011011101000110100001101001011100110101111101101001011100110101111101110100011010000110010101011111011001100110000101101011011001010101111101100110011011000110000101100111010111110110000101101110011001000101111101100011011000010110111001011111011110010110111101110101010111110110011001101001011011100110010001011111011101000110100001100101010111110111010001110010011101010110010101011111011001100110110001100001011001110111110100001010001011110010111100100000011001010110111001100011011100100111100101110000011101000110010101100100010111110111010001111000011101000011001000100000001111010010000000110111001101100010110000110001001100100011011100101100001100110011001100101100001101100011001100101100001100010011000000111000001011000011000100110010001101110010110000110001001100010011000000101100001100010011000000110010001011000011000100110010001100000010110000110001001100000011100100101100001100010011001000110100001011000011010100110110001011000011010000110111001011000011000100110001001110000010110000110001001100000011011100101100001100010011001000110101001011000011000100110010001100010010110000110001001100000011010000101100001110010011100000101100001100010011001000110011001011000011000100110000001101100010110000110001001100100011001100101100001101010011011100101100001101000011001000101100001100010011000100110111001011000011000100110010001101100010110000110011001110010010110000110100001110010010110000110001001100000011000100101100001100010011000100110101001011000011000100110000001100110010110000110001001100010011011100101100001100010011000100110111001011000011000100110000001110010010110000110001001100010011011100101100001110010011011000101100001101010011011100101100001101000011011000101100001100010011000000111001001011000011000100110001001101010010110000110001001100010011000000101100001100010011000000110100001011000011000100110000001101010010110000110001001100000011011000101100001100010011001000110011001011000011000100110000001100000010110000110001001100000011010100101100001101000011010000101100001101010011010100101100001100010011000100110100001011000011000100110010001101110010110000110100001101010010110000110110001100000010110000110001001100100011000100101100001100010011001000110010001011000011000100110001001100110010110000110001001100010011000000101100001100010011000000110100001011000011010000111000001011000011010100110011001011000011000100110001001100110010110000110001001100010011011100101100001100110011100100101100001101010011011000101100001100010011001000110101001011000011000100110000001101010010110000110001001100010011010000101100001100010011001000110001001011000011000100110000001100000010110000110001001100000011000100101100001101000011100100101100001101010011100000101100001100010011000000110000001011000011000100110010001101110010110000110101001101110010110000110101001100110010110000110001001100010011100000101100001101010011000000101100001101010011000100101100001100010011000000110110001011000011000100110000001101100010110000110001001100100011010000101100001100110011100000101100001101010011010000101100001100010011001000110111001011000011011000110000001011000011000100110000001110000010110000110001001100000011100100101100001100010011000100110010001011000011000100110001001101000010110000110001001100000011010100101100001100010011100100101100001100010011000100110100001011000011000100110001001100000010110000111001001110000010110000110001001100010011010000101100001100010011000100110101001011000011100000110001001011000011000100110001001101010010110000111000001101010010110000110110001101010010110000111001001110010010110000111000001101010010110000110110001101110010110000110100001101000010110000110011001101100010110000110001001100000011100000101100001100010011000000110010001011000011000100110000001101110010110000111001001100100010110000110011001100010010110000110100001101000010110000111000001110000010110000111000001110000010110000110001001100010011010100101100001101010011010100101100001101000011100000101100001101110011001100101100001110000011011000101100001101100011100000101100001110010011001100101100001100010011000100110010001011000011000100110010001100110010110000110111001110010010110000110001001100100011011100101100001100010011010100101100001101010011000100101100001100010011001000110000001011000011100100110110001011000011000100110010001100010010110000110111001101000010110000110001001100010011010000101100001110010011010000101100001100010011001000110000001011000011100000110010001011000011100100110001001011000011010000110001001011000011010000110100001011000011000100110000001101010010110000111000001100100010110000110111001100010010110000110011001101110010110000110001001100010011000000101100001100100011100000101100001101100011100100101100001110010011011000101100001100010011000000110000001011000011010000110010001011000011001000101100001101110011010100101100001100010011000100111000001011000011000100110010001100100010110000110011001101010010110000110100001110010010110000111000001110010000101000001010

解密会得到一个cpp源码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include<bits/stdc++.h>
using namespace std;
string key = "";

int main(){
string crypto_txt;
cin>>crypto_txt;

for (int i = 0; i < crypto_txt.length(); ++i){
char encrypted_txt = char(crypto_txt[i] ^ key[i % key.length()] ^ crypto_txt[(i + 1) % crypto_txt.length()]);
cout << int(encrypted_txt) << " ";
}
return 0;
}

// encrypted_txt1 = 122,127,111,111,96,114,115,127,77,90,119,92,89,117,126,85,87,117,111,111,86,84,122,127,111,75,81,97,120,94,93,110,98,65,84,127,105,69,87,125,98,107,87,70,108,127,83,88,105,105,98,95,88,102,96,118,104,114
// dncrypted_txt = flag{this_is_the_fake_flag_and_can_you_find_the_true_flag}
// encrypted_txt2 = 76,127,33,63,108,127,110,102,120,109,124,56,47,118,107,125,121,104,98,123,106,123,57,42,117,126,39,49,101,115,103,117,117,109,117,96,57,46,109,115,110,104,105,106,123,100,105,44,55,114,127,45,60,121,122,113,110,104,48,53,113,117,39,56,125,105,114,121,100,101,49,58,100,127,57,53,118,50,51,106,106,124,38,54,127,60,108,109,112,114,105,19,114,110,98,114,115,81,115,85,65,99,85,67,44,36,108,102,107,92,31,44,88,88,115,55,48,73,86,68,93,112,123,79,127,15,51,120,96,121,74,114,94,120,82,91,41,44,105,82,71,37,110,28,69,96,100,42,2,75,118,122,35,49,89

给了一个fakeflag的明文和密文,很明显是要算密钥

1
2
3
4
5
6
c = [122,127,111,111,96,114,115,127,77,90,119,92,89,117,126,85,87,117,111,111,86,84,122,127,111,75,81,97,120,94,93,110,98,65,84,127,105,69,87,125,98,107,87,70,108,127,83,88,105,105,98,95,88,102,96,118,104,114]
m = 'flag{this_is_the_fake_flag_and_can_you_find_the_true_flag}'
for i in range(len(m)):
print(chr(ord(m[i])^ord(m[(i+1)%len(m)])^c[i]),end='')
# prisonrealmprisonrealmprisonrealmprisonrealmprisonrealmpri
# key = prisonrealm

拿到密钥解密即可,推测最后一个字符是},依次还原

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
key = 'prisonrealm'
enc = [76,127,33,63,108,127,110,102,120,109,124,56,47,118,107,125,121,104,98,123,106,123,57,42,117,126,39,49,101,115,103,117,117,109,117,96,57,46,109,115,110,104,105,106,123,100,105,44,55,114,127,45,60,121,122,113,110,104,48,53,113,117,39,56,125,105,114,121,100,101,49,58,100,127,57,53,118,50,51,106,106,124,38,54,127,60,108,109,112,114,105,19,114,110,98,114,115,81,115,85,65,99,85,67,44,36,108,102,107,92,31,44,88,88,115,55,48,73,86,68,93,112,123,79,127,15,51,120,96,121,74,114,94,120,82,91,41,44,105,82,71,37,110,28,69,96,100,42,2,75,118,122,35,49,89]
# flag[-1] = '}' 即flag[-1] = 125
flag = []
for i in range(len(enc)):
flag.append(enc[i]^ord(key[i%len(key)]))
t = [0]*len(flag)
t[0] = 125 ^ flag[-1]
t[1:len(flag)] = flag[:-1]
print()
for i in range(len(flag)-1):
print(chr(t[i]),end='')
t[i+1] = flag[i]^t[i]
print('}')
# The-absolute-powerhouse,the-resulting-loneliness,the-person-who-teaches-you-to-love-is......NSSCTF{e@sy_s1gnin_0n_th1s_h@ppy_S3nday_@nd_w1sh_y03_hav3_fun!}

easy_signin2

做做misc签到题来放松吧!
相信你一定可以愉快的签到
flag以NSSCTF{}格式提交

hint: 二进制异或 pngchunk
hint2: 抽象画

附件看到两张图,先去看一下here_is_your_flag.png,用010打卡发现根本不是png图片数据,题目给了提示是要异或pngchunk,但是不知道异或什么,因为我们知道png的是89开始的,所以用现在的第一个字节去异或89,就可以得到应该要异或的字节了

image-20240516093546408

1
2
>>> print(hex(0xcd^0x89))
0x44

可以看到我们要异或的应该是0x44,所以我们把这个文件的每一字节提取出来然后去异或0x44并写入文件

image-20240516095435045

image-20240516095509457

image-20240516104523600

得到

here_is_your_flag

通过提示可以看到查看pngchunk

image-20240516110245852

image-20240516110306386

从这里开始往下复制,然后添加文件头89 50 4e 47 0d 0a 1a 0a即可得到

1

hint2提示抽象画,可以想到用npiet

去这里下载:http://www.bertnase.de/npiet/

然后看另一个png,10xbig_to_more_clear.png

用脚本放大十倍

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
from PIL import Image

def process_image(input_image_path, output_image_path):
# 打开图像
image = Image.open(input_image_path).convert('L')
# 获取图像的像素数据
pixels = image.load()
width, height = image.size

# 遍历图像的每个像素
for y in range(height):
for x in range(width):
# 获取当前像素的灰度值
pixel_value = pixels[x, y]

# 如果像素值在10到200之间,将其设置为255
if 0 < pixel_value < 250:
pixels[x, y] = 0

# 保存修改后的图像
image.save(output_image_path)

# 输入和输出图像的文件路径
input_image_path = "10xbig_to_more_clear.png"
output_image_path = "out.png"

# 处理图像
process_image(input_image_path, output_image_path)

out

得到字符串di`f{cfd7d1fd1ba254dcfa7f4155cfdadadc}

1
2
3
4
5
6
7
\npiet-1.3a-win32>npiet.exe -v 1.png
info: verbose set to 1
info: using file 1.png
info: got 495 x 495 pixel with 256 cols
info: codelsize guessed is 15 pixel
? di`f{cfd7d1fd1ba254dcfa7f4155cfdadadc}
f? l? a? g? {? d? g? e? 8? f? 3? h? f? 3? d? a? 4? 5? ? ? cd4? ? ? ? ? ? 14f7af? ? ? ? fc5? d? b5? ? ? dad? d? }? ?

flag{dge8f3hf3da45cd414f7affc5db5dadd}

NSSCTF{dge8f3hf3da45cd414f7affc5db5dadd}