【安全】requests和BeautifulSoup小试牛刀
2015-06-12 23:00
323 查看
web安全的题,为了找key随手写的程序,无处安放,姑且贴上来。
不断修改id访问URL2000次,分析返回的页面。
# -*- coding: UTF-8 -*- __author__ = 'weimw' import requests from BeautifulSoup import BeautifulSoup def request_ctf5(): f = open("out.txt", "w") for i in range(1, 2000): url = 'http://ctf5.simplexue.com/8/index.php?id=' + str(i) res = requests.get(url) res_table = BeautifulSoup(res.content).find('table') tr_1 = res_table.findAll('tr')[0] try: tr_2 = res_table.findAll('tr')[1] except: print >> f, "no id and content" continue id_t = tr_2.findAll('td')[0].text content_t = tr_2.findAll('td')[1].text if id_t and content_t: print >> f, "id = %s, content = %s" % (id_t, content_t) return if __name__ == '__main__': request_ctf5()
不断修改id访问URL2000次,分析返回的页面。
相关文章推荐
- 文顶顶 iOS开发UI篇—手写控件,frame,center和bounds属性 iOS开发UI基础—手写控件,frame,center和bounds属性
- JDBC中PreparedStatement接口提供的execute、executeQuery和executeUpdate之间的区别及用法
- Using JavaFX UI Controls 12 Table View
- White spaces are required between publicId and systemId.异常
- Leetcode[96]-Unique Binary Search Trees
- CodedUI自动化测试及脱离VS独立运行
- QuickNewsLibs
- Marquee 跑马效果
- Linguist API 语言专家
- ios开发-UI进阶-核心动画-时钟动画小案例
- WordSequence API
- poj 2299 Ultra-QuickSort
- UITabBarController用法详解 - iOS - UI基础知识总结15
- Android异步处理三:Handler+Looper+MessageQueue深入详解
- Quick Reference:php5 Xdebug 生成Profiles
- Android异步处理二:使用AsyncTask异步更新UI界面
- Android异步处理一:使用Thread+Handler实现非UI线程更新UI界面
- iOS开发UI篇—0408控制器View的生命周期方法
- TopCoder SRM 661 Div2 Problem 500 - BridgeBuildingDiv2 (枚举 + 状态压缩)
- UI之各种控件的属性及使用方法说明(一)