BUUCTF-MISC-梅花香之苦寒来

1. 图片使用binwalk分析发现没有隐藏文件。

2. 使用WinHex查看发现图片后有大量的十六进制数值,因此编写脚本进行十六进制转ASCII。

  • 十六进制转ASCII输出到文件

    with open('hex.txt','r') as h:
    h=h.read()
    tem=''
    f = open("ascii.txt", "w")
    for i in range(0,len(h),2):
    tem='0x'+h[i]+h[i+1]
    tem=int(tem,base=16)
    print(chr(tem),end='',file=f)

3. 类似于坐标,使用kali的gnuplot,转换为图像坐标点,gnuplot不识别括号“()”,编写脚本去掉括号。

  • 去掉括号后输出到文件

    with open('ascii.txt','r')as a:
    a=a.read()
    a=a.split()
    tem=''
    f=open('plot.txt','w')
    for i in range(0,len(a)):
    tem=a[i]
    tem=tem.lstrip('(')
    tem=tem.rstrip(')')
    for j in range(0,len(tem)):
    if tem[j]==',':
    tem=tem[:j]+' '+tem[j+1:]
    print(tem,file=f)

4. 画图得到二维码,扫描得到flag。

posted on 2020-11-11 23:37  千丶颜  阅读(1411)  评论(0)    收藏  举报