pythonchallenge闯关 第6题

6、Hint:(1)<!-- <-- zip -->

试着把URL后缀.html改为.zip

发现可以下载

zip文件最后有一个readme.txt

Hint:(2)start from 90052

  (3)answer is inside the zip

打开90052 发现类似于第四题 不过一个是网页一个是文件

import zipfile
import re

z = zipfile.ZipFile('channel.zip', mode='r')

filecontent = z.read('90052.txt')

filecontent = filecontent.decode('utf-8')

print(filecontent)
(6.1)

跳转到最后的文件内容是:Collect the comments.

import zipfile
import re

z = zipfile.ZipFile('channel.zip', mode='r')

filecontent = z.read('90052.txt')

filecontent = filecontent.decode('utf-8')

print(filecontent)

l = [z.getinfo('90052.txt').comment.decode('utf-8')]

filenameprev = re.findall(r'[0-9]', filecontent)

while len(filenameprev) != 0:
    filename = ''.join(filenameprev) +'.txt'
    filecontent = z.read(filename).decode('utf-8')
    print(filecontent)
    l.append(z.getinfo(filename).comment.decode('utf-8'))
    filenameprev = re.findall(r'[0-9]', filecontent)

print(''.join(l))
(6.2)

最后显示的是由O,X,Y,G,E,N和*组成的HOCKEY

替换URL为oxygen进入下一题

posted @ 2017-10-01 11:33  anixtt  阅读(168)  评论(0编辑  收藏  举报