Advertisement

CTF-MISC-大白-WP

阅读量:

0x01 思路

下载完成后,在 Linux 环境中进行分析后发现无法打开该图片表明该图片的 CRC 校验存在问题。无需在 Windows 环境中进行分析的原因是 Windows 软件能够正确处理具有 CRC 错误的 PNG 图片文件。

在这里插入图片描述

0x02 python 脚本编写

复制代码
    #coding=utf-8
    import os
    import binascii
    import struct
    
    
    misc = open("dabai.png","rb").read()
    
    for i in range(1024):
    data = misc[12:20] +struct.pack('>i',i)+ misc[24:29]
    crc32 = binascii.crc32(data) & 0xffffffff
    if crc32 == 0x6d7c7135:
        print i

运行该脚本后将可得 height 值变为 479;通过 Python 将其转换为十六进制形式即得到 0x1df。

0x03 Winhex

在 Winhex 中打开 dabai.png
在00000010开始前四位为宽,后四位为高

在这里插入图片描述

修改高为 00 00 01 df 后保存

在这里插入图片描述

0x04 得到修复后的图片

在这里插入图片描述

flag{He1l0_d4_ba1}

全部评论 (0)

还没有任何评论哟~