The Python Challenge : http://www.pythonchallenge.com/

Level 0:

看提示图片中为2**38,计算值为274877906944。

Hint: try to change the URL address.

下一关地址:http://www.pythonchallenge.com/pc/def/274877906944.html

Level 1:

Hint 1:K->M  O->Q  E->G

此提示可看出是位移计算,都是位移两位

Hint 2:g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj.

想必是利用Hint 1的唯一算法转换字符串,得到下一关的地址信息,需要注意的是转换是在26个字母中转换的,不多说,上代码

s = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj."
def change_str(s):if s is 'y':return 'a'if s is 'z':return 'b'if s.isalpha() and s not in 'yz':return chr(ord(s)+2)return sns = map(change_str, s)
print ''.join(ns)

解密得到:i hope you didnt translate it by hand. thats what computers are for. doing it in by hand is inefficient and that's why this text is so long. using string.maketrans() is recommended. now apply on the url.

根据提示,使用同样的方法转换map,得到ocr

下一关地址:http://www.pythonchallenge.com/pc/def/ocr.html

Level 2:

根据提示密码藏在图片的书中,或者页面源码中,看了下图片果断F12,看到页面源码中有一大段字符串,提示找出重复最少的

import collections
def mycount(s):lit = []lit_num = []for item in s:if item in lit:continuelit.append(item)for item in lit:num = s.count(item)lit_num.append(num)return collections.OrderedDict(zip(lit, lit_num))dic = mycount(s)
for k, v in dic.iteritems():print k, '=', v

由于字符是有顺序的,所以这里我使用了有序的字典,进行存储字符跟出现次数,得到结果为;equality

下一关地址:http://www.pythonchallenge.com/pc/def/equality.html

Level 3:

Hint :One small letter, surrounded by EXACTLY three big bodyguards on each of its sides.

找到这么一个小写字母,两边都是三个大写字母,要求:xXXXxXXXx

两边都是连续的三个大写字母,所以再边上就要是小写字母,不然就不满足要求了

在哪里找这些字符呢??查看页面源码,发现有一大串字符串,一定是在这里找了。

使用正则表达式进行查找字符串,附上代码:

regex = r"[^A-Z][A-Z]{3}[a-z][A-Z]{3}[^A-Z]"
REGEX = re.compile(regex)
result = REGEX.findall(s)
print result

得到:['qIQNlQSLi', 'eOEKiVEYj', 'aZADnMCZq', 'bZUTkLYNg', 'uCNDeHSBj', 'kOIXdKBFh', 'dXJVlGZVm', 'gZAGiLQZx', 'vCJAsACFl', 'qKWGtIDCj']

取的小写字母得:linkedlist

访问:http://www.pythonchallenge.com/pc/def/linkedlist.html,得到linkedlist.php

下一关地址:http://www.pythonchallenge.com/pc/def/linkedlist.php

Level 4:

点击图片跳转页面显示:and the next nothing is 44827

查看页面源码发现: urllib may help. DON'T TRY ALL NOTHINGS, since it will never
end. 400 times is more than enough.

尝试把nothing改为44827,页面跳转显示:and the next nothing is 45439

根据提示应该是要一直访问,访问400次就的到下一关页面

import urllib
from bs4 import BeautifulSoupdef challenge(noth):url = "http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing={}".format(noth)responce = urllib.urlopen(url)html = responce.read()soup = BeautifulSoup(html, 'lxml')body_text = soup.find('body').textnothing = (body_text.split('.')).pop()if 'html' == nothing:print 'Congratulations!!!!-----------------------------------------------'print body_textelse:print '-----------------------------------------------------------------'print body_textnothing = (body_text.split(' ')).pop()try:if isinstance(int(nothing), int):return challenge(nothing)except ValueError:nothing = int(noth) / 2print nothingprint '--------------------------------------------------------------'return challenge(nothing)

查看记录得到:peak.html

下一关地址:http://www.pythonchallenge.com/pc/def/peak.html

Level 5:

这题有点坑爹,找不到突破点,百度了下,根据发音的到需要用pickle处理数据,晕....

查看源码,下载banner.p,打开看了下,确实像是pickle处理过的,使用pickle处理得到

[[(' ', 95)], [(' ', 14), ('#', 5), (' ', 70), ('#', 5), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 6), ('#', 3), (' ', 6), ('#', 4), (' ', 3), ('#', 3), (' ', 9), ('#', 3), (' ', 7), ('#', 5), (' ', 3), ('#', 3), (' ', 4), ('#', 5), (' ', 3), ('#', 3), (' ', 10), ('#', 3), (' ', 7), ('#', 4), (' ', 1)], [(' ', 3), ('#', 3), (' ', 3), ('#', 2), (' ', 4), ('#', 4), (' ', 1), ('#', 7), (' ', 5), ('#', 2), (' ', 2), ('#', 3), (' ', 6), ('#', 4), (' ', 1), ('#', 7), (' ', 3), ('#', 4), (' ', 1), ('#', 7), (' ', 5), ('#', 3), (' ', 2), ('#', 3), (' ', 5), ('#', 4), (' ', 1)], [(' ', 2), ('#', 3), (' ', 5), ('#', 3), (' ', 2), ('#', 5), (' ', 4), ('#', 4), (' ', 3), ('#', 3), (' ', 3), ('#', 4), (' ', 4), ('#', 5), (' ', 4), ('#', 4), (' ', 2), ('#', 5), (' ', 4), ('#', 4), (' ', 3), ('#', 3), (' ', 5), ('#', 3), (' ', 3), ('#', 4), (' ', 1)], [(' ', 1), ('#', 3), (' ', 11), ('#', 4), (' ', 5), ('#', 4), (' ', 3), ('#', 3), (' ', 4), ('#', 3), (' ', 4), ('#', 4), (' ', 5), ('#', 4), (' ', 2), ('#', 4), (' ', 5), ('#', 4), (' ', 2), ('#', 3), (' ', 6), ('#', 4), (' ', 2), ('#', 4), (' ', 1)], [(' ', 1), ('#', 3), (' ', 11), ('#', 4), (' ', 5), ('#', 4), (' ', 10), ('#', 3), (' ', 4), ('#', 4), (' ', 5), ('#', 4), (' ', 2), ('#', 4), (' ', 5), ('#', 4), (' ', 2), ('#', 3), (' ', 7), ('#', 3), (' ', 2), ('#', 4), (' ', 1)], [('#', 4), (' ', 11), ('#', 4), (' ', 5), ('#', 4), (' ', 5), ('#', 2), (' ', 3), ('#', 3), (' ', 4), ('#', 4), (' ', 5), ('#', 4), (' ', 2), ('#', 4), (' ', 5), ('#', 4), (' ', 1), ('#', 4), (' ', 7), ('#', 3), (' ', 2), ('#', 4), (' ', 1)], [('#', 4), (' ', 11), ('#', 4), (' ', 5), ('#', 4), (' ', 3), ('#', 10), (' ', 4), ('#', 4), (' ', 5), ('#', 4), (' ', 2), ('#', 4), (' ', 5), ('#', 4), (' ', 1), ('#', 14), (' ', 2), ('#', 4), (' ', 1)], [('#', 4), (' ', 11), ('#', 4), (' ', 5), ('#', 4), (' ', 2), ('#', 3), (' ', 4), ('#', 4), (' ', 4), ('#', 4), (' ', 5), ('#', 4), (' ', 2), ('#', 4), (' ', 5), ('#', 4), (' ', 1), ('#', 4), (' ', 12), ('#', 4), (' ', 1)], [('#', 4), (' ', 11), ('#', 4), (' ', 5), ('#', 4), (' ', 1), ('#', 4), (' ', 5), ('#', 3), (' ', 4), ('#', 4), (' ', 5), ('#', 4), (' ', 2), ('#', 4), (' ', 5), ('#', 4), (' ', 1), ('#', 4), (' ', 12), ('#', 4), (' ', 1)], [(' ', 1), ('#', 3), (' ', 11), ('#', 4), (' ', 5), ('#', 4), (' ', 1), ('#', 4), (' ', 5), ('#', 3), (' ', 4), ('#', 4), (' ', 5), ('#', 4), (' ', 2), ('#', 4), (' ', 5), ('#', 4), (' ', 2), ('#', 3), (' ', 12), ('#', 4), (' ', 1)], [(' ', 2), ('#', 3), (' ', 6), ('#', 2), (' ', 2), ('#', 4), (' ', 5), ('#', 4), (' ', 2), ('#', 3), (' ', 4), ('#', 4), (' ', 4), ('#', 4), (' ', 5), ('#', 4), (' ', 2), ('#', 4), (' ', 5), ('#', 4), (' ', 3), ('#', 3), (' ', 6), ('#', 2), (' ', 3), ('#', 4), (' ', 1)], [(' ', 3), ('#', 3), (' ', 4), ('#', 2), (' ', 3), ('#', 4), (' ', 5), ('#', 4), (' ', 3), ('#', 11), (' ', 3), ('#', 4), (' ', 5), ('#', 4), (' ', 2), ('#', 4), (' ', 5), ('#', 4), (' ', 4), ('#', 3), (' ', 4), ('#', 2), (' ', 4), ('#', 4), (' ', 1)], [(' ', 6), ('#', 3), (' ', 5), ('#', 6), (' ', 4), ('#', 5), (' ', 4), ('#', 2), (' ', 4), ('#', 4), (' ', 1), ('#', 6), (' ', 4), ('#', 11), (' ', 4), ('#', 5), (' ', 6), ('#', 3), (' ', 6), ('#', 6)], [(' ', 95)]]

看到元组的第一个元素不是空格就是#,第二个元素可能是个数,尝试了下

import pickle
f = open('banner.p')l = pickle.load(f)
print l
print '\n'.join([''.join([p[0] * p[1] for p in item]) for item in l])for item in l:for p in item:s = p[0] * p[1]f.close()

果真是一幅图

              #####                                                                      ##### ####                                                                       #### ####                                                                       #### ####                                                                       #### ####                                                                       #### ####                                                                       #### ####                                                                       #### ####                                                                       #### ###      ####   ###         ###       #####   ###    #####   ###          ###       #### ###   ##    #### #######     ##  ###      #### #######   #### #######     ###  ###     #### ###     ###  #####    ####   ###   ####    #####    ####  #####    ####   ###     ###   #### ###           ####     ####   ###    ###    ####     ####  ####     ####  ###      ####  #### ###           ####     ####          ###    ####     ####  ####     ####  ###       ###  ####
####           ####     ####     ##   ###    ####     ####  ####     #### ####       ###  ####
####           ####     ####   ##########    ####     ####  ####     #### ##############  ####
####           ####     ####  ###    ####    ####     ####  ####     #### ####            ####
####           ####     #### ####     ###    ####     ####  ####     #### ####            #### ###           ####     #### ####     ###    ####     ####  ####     ####  ###            #### ###      ##  ####     ####  ###    ####    ####     ####  ####     ####   ###      ##   #### ###    ##   ####     ####   ###########   ####     ####  ####     ####    ###    ##    #### ###     ######    #####    ##    #### ######    ###########    #####      ###      ######

坑爹!坑爹!

下一关地址:http://www.pythonchallenge.com/pc/def/channel.html

Level 6:

Hint:查看页面源码,发现注释zip,可能与Zip文件有关

将channel.html改为channel.zip,还真有zip文件;

打开zip文件,看到有个readme.txt,内容如下:

welcome to my zipped list.
hint1: start from 90052
hint2: answer is inside the zip
发现其他文件名都是数字,于是采用zipfile模块处理文件,献上代码:

import zipfilefile_zip = zipfile.ZipFile('channel.zip')
files = file_zip.namelist()
def item(start):if start in files:with file_zip.open(start) as f:content = f.read()print contentresult = '{}.txt'.format(content.split(' ').pop())return item(result)else:result = start.split('.')print 'The result is: ', result[0]if __name__ == '__main__':item('90052.txt')

程序最后得到:Collect the comments.

comment??哪里来的comment,想到可能是文件的,查看到zipfile有个comment属性

于是修改程序,收集每个文件的comment,

import zipfilefile_zip = zipfile.ZipFile('channel.zip')
files = file_zip.namelist()
lst = []
def item(start):if start in files:with file_zip.open(start) as f:content = f.read()com = file_zip.getinfo(start).commentlst.append(com)print contentresult = '{}.txt'.format(content.split(' ').pop())return item(result)else:result = start.split('.')print 'The result is: ', result[0]if __name__ == '__main__':item('90052.txt')result = ''.join(lst)print result

得到:

****************************************************************
****************************************************************
**                                                            **
**   OO    OO    XX      YYYY    GG    GG  EEEEEE NN      NN  **
**   OO    OO  XXXXXX   YYYYYY   GG   GG   EEEEEE  NN    NN   **
**   OO    OO XXX  XXX YYY   YY  GG GG     EE       NN  NN    **
**   OOOOOOOO XX    XX YY        GGG       EEEEE     NNNN     **
**   OOOOOOOO XX    XX YY        GGG       EEEEE      NN      **
**   OO    OO XXX  XXX YYY   YY  GG GG     EE         NN      **
**   OO    OO  XXXXXX   YYYYYY   GG   GG   EEEEEE     NN      **
**   OO    OO    XX      YYYY    GG    GG  EEEEEE     NN      **
**                                                            **
******************************************************************************************************************************

访问:http://www.pythonchallenge.com/pc/def/hockey.html

得到:it's in the air. look at the letters.

还没完成,看到comments里有些字母,“OXYGEN”,将hockey改为oxygen得带下一关地址

下一关地址:http://www.pythonchallenge.com/pc/def/oxygen.html

持续更新

转载于:https://www.cnblogs.com/alummox/p/7309367.html

The Python Challenge 闯关笔记相关推荐

  1. the python challenge闯关记录(9-16)

    9 第九关 是一张图,上面有很多的黑点,查看网页源代码发现了上一关的提示: 还发现了一大串的数字 感觉又是一个使用PIL库进行图像处理的题,百度后知道要将这些点连接起来并重新画图.但是不能在原始图上修 ...

  2. Python 爬虫闯关

    (个人经验,仅供参考,错误之处,敬请谅解) 前言 学到python的爬虫,有个链接是黑板课闯爬虫关的,于是去试了下     第一关     第二关     第三关:链接以此类推,不过有个防护,登陆之后 ...

  3. python challenge 0-6关 攻略

    在逛北邮人论坛python版时看到暖神推荐的python challenge这个编程通关小游戏,挺有意思的,还能用来练python.一直觉的自己会的太少,但是又不知道该从哪补起,该看些什么.这个编程小 ...

  4. python制作闯关答题软件_闯关答题-可以用做问答互动的软件-闯关答题会议 微信 问答游戏GO互动智能现场...

    画面精美,年味与科技感十足 闯关答题是益智类的互动游戏,可以满足各个年龄段的需求.来宾扫码进入游戏之后,主办方在大屏点击开始问问题,来宾就可开始答题闯关了,每道题有规定的时间,在规定时间内答对则晋级, ...

  5. python制作闯关答题软件_教你轻松使用优考试制作互动闯关答题

    我们可以使用优考试在线考试系统组织招聘考试.培训考试.员工考核,或者是给学生做每日一练.模拟考试,或者我们可以拿来协助创建在线的知识竞赛比赛.但是,其实优考试推出了一个新的功能,就是创建闯关答题的功能 ...

  6. python challenge 7-12关 攻略

    第7关 http://www.pythonchallenge.com/pc/def/oxygen.html 没有提示,源代码也是什么都没有.好吧.只有一张图片,而且这张图片也挺奇怪的,为什么中间有一横 ...

  7. wargames bandit 闯关笔记

    Level 0 account : bandit0 password : bandit0 使用secureCRT 连接服务器 Level 0-1 account : bandit0 password ...

  8. XSS challenges闯关笔记

    文章目录 stage-1 没有过滤的XSS stage-2 标签属性中的XSS stage-3 选择列表中的XSS stage-4 隐藏提交参数中的XSS stage-5 限制输入长度的XSS sta ...

  9. python制作闯关答题软件_Pygame制作答题类游戏的实现

    概述 个人比较喜欢玩这些答题类的游戏,在这类的游戏中其实存在着一些冷知识在里面.练习pygame的过程中,在网络上搜索,几乎没有找到这类游戏的示例教程,就蒙生了制作一个答题游戏的念头,最开始的时候,这 ...

  10. sqli-labs闯关笔记(Challenges)

    sqli-labs项目地址:https://github.com/Audi-1/sqli-labs 文章目录 Less-54 Less-55 Less-56 Less-57 Less-58 Less- ...

最新文章

  1. 数据库经典书籍--SQL必知必会
  2. java 普通项目转web项目
  3. 请求solr服务器未响应,solr与tomcat整合
  4. Linux多进程拷贝文件
  5. 解决虚拟机 正在决定eht0 的ip信息失败 无链接-- 添加虚拟网卡
  6. java面试总结(第一天)
  7. bootstrap table 表格支持shirt 多选_bootstrap-table 表格行内编辑实现
  8. java g1的并行_Java 11好用吗
  9. 成为高级测试人:软件测试工程师职业素养
  10. sqlite to mysql_SqliteToMysql官方下载
  11. gorm软删除_删除 |《GORM 中文文档 v1》| Go 技术论坛
  12. vivado 2017.4安装教程
  13. 解决导入protobuf源代码Unity报错的问题
  14. 智慧时代,如何让路口交通安全又高效?
  15. 豆豆趣事[2014年08月]
  16. 2019年618提前引发“骚动”:苏宁要成为主场?!
  17. 关于心跳包的实现手法
  18. 用Python制作登录界面
  19. 五位来自五大洲的杰出女性荣获联合国教科文组织“世界杰出女科学家成就奖” | 周末...
  20. docker-前端部署

热门文章

  1. 分布式锁没那么难,手把手教你实现 Redis 分布锁!|保姆级教程
  2. git SourceTree 客户端 安装/使用教程
  3. PHP压缩html网页代码(清除空格,换行符,制表符,注释标记)
  4. LayaAir graphics 矢量绘图之 圆形与扇形
  5. 阶段3 3.SpringMVC·_02.参数绑定及自定义类型转换_7 获取Servlet原生的API
  6. vector 简单使用
  7. CENTOS 使用 MUTT发送邮件
  8. Java---类反射(1)---类反射入门和基础
  9. gulp-uglify《JS压缩》----gulp系列(四)
  10. 九度OJ - 题目1481:Is It A Tree?