题目信息

附件是网页上的一篇文章,先复制到txt中保存。

分析

如下是文章开头:

1
2
3
4
5
6
7
8
(additional editing by jose menendeZ)

thE adventuRes Of
sherlOck holmes

by

sir arthur coNan doylE

奇怪之处是有些位置不应该使用大写字母,但是使用了大写字母,推断这些大写字母是用来传递消息的。将文章中的所有大写字母提取出来,得到一串全部由ZERO与ONE组成的字符串,ZERO替换为数字0,ONE替换为数字1,从而得到一个二进制表示的数,再将此数转换为字符串即可。

解题

Python代码如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from string import uppercase
from Crypto.Util.number import long_to_bytes

def solve():
with open('paper','r') as f:
data=f.read()
cip=''
for c in data:
if c in uppercase:
cip+=c
cip=cip.replace('ZERO','0')
cip=cip.replace('ONE','1')
return long_to_bytes(long(cip,2))

if __name__=='__main__':
print solve()

程序运行结果如下:

1
2
$ python solve.py
BITSCTF{h1d3_1n_pl41n_5173}