CTF网鼎杯2020-青龙组-虚幻2 题解
因备考而搁置了大半年的题目,补坑。
初步分析
题目内容如下:
file文件,binwalk识别为png图片
改后缀,得到:
源文件下载 想自己复现的朋友可以存一下,我就不传网盘了 :-)
图片分解与合并
按套路去stegsolve中分解,RGB三色道分别保存图片
去年的虚幻考的汉信码,今年也不会例外,剩下的就是如何将图片放大并拼接,画图就可以实现,也可以用Excel等笨方法:
而汉信码的大致图案样式如下:
再次观察三色道的图片,猜测是将三张图按行拼在一起,第一行明显是Green,剩下的顺序只能猜。根据上图样式,一定记得左下方的标志位换个方向!即:
最终得到:
汉信码的纠错能力很强(比赛也是为了体现这一点并打个广告),缺的那块随便涂一下,直接去扫码即可。不过汉信码的支持做的贼差,只有一个网站能扫码结果服务器还日常炸,说是有手机客户端,结果还万年不更新完全打不开,无语…
Python脚本
首先查看像素,发现为36*12。接下来提取图片中的RGB值:
1 | # -*- coding: UTF-8 -*- |
运行得:
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111110000110111111110011111110000010000000001100111101100000000010000010111110000000110110110011111010000010100000001010100111111000001010000010101110001010110110001011101010000010101110010010101010000011101010000010101110100110100010000011101010000000000000101010101111001000000000000000000000000010101001100111011000000001101100011010110000000100100100000001111101010000101010011100000110000010101000010110111111001111000000000010001101001100110011001111110000000000000000000000110001000001111000000011111111111111111110010010001010000011101001001000010110000111101000000011101010000101101110011010110100000010101010100110111001110010001110000010000101100001000101111000011110000011010110000111111101110100101110000011011011110010011110111101100010000011101001110010100001011001000110000000110111000100110111010000000000000000000000101110101111101000000000000010101110001111000000000011101010000010101110010000000000000011101010000010101110101011000000000011101010000010100000100000000000000000001010000010111110010110000000000011111010000010000000000000000000000000000010000011111110011000000000000011111110000000000000000000000000000000000000000000000000000000000000000000000000
生成图片,1就是255,0就是0:
1 | from PIL import Image |
得到:
合并脚本如下:
1 | # -*- coding: UTF-8 -*- |
记得改定位符方向,没有flag总是感觉缺点什么,放上其他师傅的图(
附:祝贺石家庄解封,河北继续加油!