WeChall - Stegano Woman

Challenge

Another challenge by Z. download it here

下载 stegano_woman.zip,解压得到 1.jpg2.jpg

Solution

ZIP 文件本身就有玄机。用 Python 的 zipfile 模块读取 ZIP 的 comment 字段:

1
2
3
import zipfile
with zipfile.ZipFile('stegano_woman.zip') as z:
print(repr(z.comment))

输出:

1
b'Stegano\r\n\t \t \t \t\t\t  \t \t\t\t\t  ...'

Stegano 后面跟着大量 \t(tab)和空格。这是经典的空白隐写(whitespace steganography)。

解码方法:tab=0,space=1(或反过来),每 8 位组成一个 ASCII 字符。

1
2
3
comment = z.comment.split(b'Stegano\r\n')[1].decode()
binary = comment.replace('\t', '0').replace(' ', '1')
text = ''.join(chr(int(binary[i:i+8], 2)) for i in range(0, len(binary), 8))
dangerous life