ecb,_it’s_easy_as_123
Somebody leaked a still from the upcoming Happy Feet Three movie,
which will be released in 4K, but Warner Bros. was smart enough
to encrypt it. But those idiots used a black and white bmp format,
and that wasn’t their biggest mistake. Show 'em who’s boss and
get the flag.
翻译一下
有人泄露了即将上映的《快乐的脚》电影中的一个静物,
它将在4K中发布,但华纳兄弟足够聪明
加密它。但是那些白痴用的是黑白bmp格式,
这并不是他们最大的错误。让他们知道谁是老板
拿旗子。
bmp文件用ps打开没成功,
用010Editor打开
发现文件开头并不是bmp的文件开头
(关于了解bmp,可以看:https://blog.csdn.net/qingchuwudi/article/details/25785307)
先尝试了在文件前面加bmp的文件头
没成功
查了大佬的代码
from Crypto.Util.number import long_to_bytes
with open('ecb.bmp','rb') as f:
data=f.read()
pre=0x424d76483f00000000007600000028000000000f000070080000010004000000000000483f00000000000000000000000000000000000000000000008000008000000080800080000000800080008080000080808000c0c0c0000000ff0000ff000000ffff00ff000000ff00ff00ffff0000ffffff00ffffffffffffffffffffL
out=long_to_bytes(pre)+data[128:]
with open('out.bmp','wb') as g:
g.write(out)
也就是将前128位字符替换成bmp应该的前128位字符
运行得到
所以最后答案为:
flag{no_penguin_here}