附件一张动图,只有两种颜色,只可能是二进制使用python脚本分离图片
import os
from PIL import Image
def main(gif_file):
png_dir = 'result/'
img = Image.open(gif_file)
try:
while True:
current = img.tell()
img.save(png_dir + str(current + 1) + '.png')
img.seek(current + 1)
except:
pass
if __name__ == '__main__':
gif_file = 'out.gif'
main(gif_file)
得到576张png图片
根据每张图片上的方块颜色得到二进制数据
import os
from PIL import Image
def main():
png_dir = 'result/'
ret = ""
for i in range(0,24):
line = ""
for j in range(0,24):
file_name = "result/" + str(i * 24 + j + 1) + ".png"
x = j * 10 + 5
y = i * 10 + 5
img = Image.open(file_name)
img = img.convert("RGB")
img_array = img.load()
r, g, b = p = img_array[x, y]
if g == 255:
line += "0"
if r == 255 and b == 255:
line += "1"
if len(line) == 8:
ret += chr(int(line, 2))
line = ""
print(ret)
if __name__ == '__main__':
main()
得到一串
o8DlxK+H8wsiXe/ERFpAMaBPiIcj1sHyGOMmQDkK+uXsVZgre5DSXw==hhhhhhhhhhhhhhhh
再使用foremost分离得到一张png
得到key ctfer2333
使用des解密数据得到flag
在线DES加密解密、DES在线加密解密、DES encryption and decryption--查错网 (chacuo.net)
flag{2ce3b416457d4380dc9a6149858f71db}