前言
继续ctf的旅程
攻防世界Misc高手进阶区的4分题
本篇是red_green的writeup
发现攻防世界的题目分数是动态的
就仅以做题时的分数为准了
解题过程
得到一张png
扔进stegsolve
调整通道
发现点东西
保存下来
得到flag
官方wp给出脚本
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15from PIL import Image import os import bitstring image_name = 'flag.jpg' current_path = os.path.dirname(__file__) with open(os.path.join(current_path,image_name),'rb') as f: bin_content = bitstring.Bits(f) im = Image.new("RGB",(1024,780),(255,0,0)) pim = im.load() for i,val in enumerate(bin_content.bin): if val == '0': pim[i%1024,i/1024] = (0,255,0) im.save(os.path.join(current_path,'red_green.png'))
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21from PIL import Image import os import bitstring image_name = 'red_green.png' current_path = os.path.dirname(__file__) im = Image.open(os.path.join(current_path,image_name)) image_width = im.size[0] image_height = im.size[1] # load pixel pim = im.load() bin_result = '' for row in range(image_height): for col in range(image_width): if pim[col,row][0] == 255: bin_result += '1' else: bin_result += '0' with open(os.path.join(current_path,'result.jpg'),'wb') as f: f.write(bitstring.BitArray(bin=bin_result).bytes)
结语
没什么多的好讲
最后
以上就是帅气招牌最近收集整理的关于攻防世界 Misc高手进阶区 4分题 red_green前言结语的全部内容,更多相关攻防世界内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复