打開圖片發現確實挺奇怪的
先binwalk分析一下
除了一個png,還有一個zip文件里面有4個txt。
用foremost分離出來。
zip有密碼。
根據提示CRC32,用winrar打開
pass1.txt, pass2.txt, pass3.txt, 圖片真實CRC32.txt大小都很小,可以利用CRC32爆破出文本信息。
CRC32爆破腳本:https://github.com/theonlypwner/crc32
使用方法:
python crc32.py reverse 你的crc32密文
因為pass1.txt文件大小為4,所以信息為{0x41, 0x77, 0x73, 0x64},轉成ascii碼,Awsd。
pass2.txt文件大小為4,所以信息為{0x32, 0x30, 0x32, 0x31},轉成ascii碼,2021。
pass3.txt文件大小為4,所以信息為{0x6d, 0x7a, 0x79, 0x30},轉成ascii碼,mzy0。
圖片真實CRC32.txt文件大小為6,所以信息不確定。根據文件名字的提示,且文件大小只有6,CRC32有八位,所以應該是圖片的CRC32和這個文件的CRC32相同,為0x59f1d4be.
用010editor后者winhex打開圖片,修改CRC32
如果安裝了相應模板(Template),按F5就可以運行
發現提示CRC32不匹配,那就應該是圖片的高度和寬度不對。
用腳本計算一下png圖片的真實高度和寬度。
import binascii import struct import sys file = input("圖片地址:") fr = open(file,'rb').read() data = bytearray(fr[0x0c:0x1d]) crc32key = eval('0x'+str(binascii.b2a_hex(fr[0x1d:0x21]))[2:-1]) #原來的代碼: crc32key = eval(str(fr[29:33]).replace('\\x','').replace("b'",'0x').replace("'",'')) n = 4095 for w in range(n): width = bytearray(struct.pack('>i', w)) for h in range(n): height = bytearray(struct.pack('>i', h)) for x in range(4): data[x+4] = width[x] data[x+8] = height[x] crc32result = binascii.crc32(data) & 0xffffffff if crc32result == crc32key: print(width,height) newpic = bytearray(fr) for x in range(4): newpic[x+16] = width[x] newpic[x+20] = height[x] fw = open(file+'.png','wb') fw.write(newpic) fw.close sys.exit()
修改圖片的高度和寬度
得到正常的圖片
掃碼得到:pass4為crc32爆破出90開頭那一個
根據之前爆破的結果,pass4為9070yo。
將pass1, pass2, pass3, pass4拼湊起來:Awsd2021mzy09070yo
flag應該在flag.txt中,所以這應該就是zip的解壓密碼。
解壓后打開flag.txt得到flag
flag{Pn9_Crc32_b2ut3_f0rce}