这一次这一道题就很好的解释了前天说过的PNG格式问题

perceptron

Description

Simulating the human brain is currently impossible, but perceptron is trying to do that!

Hint 1: There are many same sizes IDAT chunks in perceptron, are all of them necessary?
Hint 2: There are other PNGs too. Try to recover them.

Analyze

​ 开局一张图

上面有很多像是随机像素点的东西,但是并没有什么用,之后打开010edit后发现有很多的IDAT,以至于比这图片的本身还要多,然后我们上次说漏的,提一下,一个png只会有一个zlib的数据块,而每一块zlib的前面有标识符78 9c,搜索后可以看到这个图像拥有三个zlib的标识符,所以他的后面还有两个图像。

​ 所以我们将每个zlib提取出来,并获取其头和结尾符号,就可以得到被隐藏在下面的图像,但是打开图像后

是一堆的乱码,一般这种情况只有宽度不匹配才会出现,所以我们只需要爆破出该图片的宽高即可。下面给出脚本:

Solve

import binascii
from Crypto.Util import number
p = open('2.png','rb').read()
# print(p[0x14:0x17]+chr(0xaf).encode()[-1:])
count = 0
for a in range(0x00,0xff):
    data = p[:0x12] + chr(0x04).encode() + chr(a).encode()[-1:] + p[0x14:0x16] + chr(0x00).encode() + chr(0xa0).encode()[-1:]
    # print(binascii.crc32(data))
    p2 = p[:0x12] + chr(0x04).encode() + chr(a).encode()[-1:] + p[0x14:0x16] + chr(0x00).encode() + chr(0xa0).encode()[-1:] + p[0x18:0x1d] + number.long_to_bytes(binascii.crc32(data)&0xffffffff) + p[0x21:]
    p1 = open('te/'+str(count)+'.png','wb')
    count += 1
    p1.write(p2)
    p1.close()

得到flag

易得flag为最后一个图片的flag

flag

SUSEC{7he_r3aL_flag_iZ_tH15}