【愚公系列】2021年11月 攻防世界-进阶题-MISC-030(red_green)
文章目录[*]
[*]
[*]一、red_green
[*]二、答题步骤
[*]
[*]1.zsteg
[*]
[*]总结
[*]
一、red_green
文件:攻防世界下载对应文件
二、答题步骤
1.zsteg
下载得到一张图片
解法一:pytho脚本
#生成脚本from PIL import Imageimport osimport bitstring#image_name = 'flag.jpg'image_name = input("请输入当前文件夹下图片的名称>>>\n")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 = (0,255,0) im.save(os.path.join(current_path,'red_green.png'))#还原脚本from PIL import Imageimport osimport bitstringimage_name = 'red_green.png'current_path = os.path.dirname(__file__)im = Image.open(os.path.join(current_path,image_name))image_width = im.sizeimage_height = im.size# load pixelpim = im.load()bin_result = ''for row in range(image_height): for col in range(image_width): if pim == 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)解法二:stegsolve,lsb隐写保存二进制
解法三:zsteg
zsteg -E b1,r,lsb,xy 2ec5da20345342909d2336aa7418afed.png > new.jpg
总结
[*]zsteg
https://blog.51cto.com/u_15437432/4798968
页:
[1]