爬取乌云上所有人民币和乌云符号的漏洞(python脚本)
import httplib
from HTMLParser import HTMLParser
import urlparse
import urllib
from bs4 import BeautifulSoup
import re
from time import sleep
'''
usage: input your wooyun cookies,then just go crawl!! author: Elliott ''' domain = 'wooyun.org'
cookies = '' # !!!!here input your wooyun cookies
user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0' def countnumber(): # the function to get page num
global domain
global cookies
global user_agent
conn = httplib.HTTPConnection(domain)
conn.request('GET','/user.php?action=openbugs','',{'Cookie':cookies,'User-Agent':user_agent,'Referer':'http://wooyun.org/index.php','Host':'wooyun.org'})
content = conn.getresponse()
content = content.read()
soup = BeautifulSoup(content)
tag = soup.find_all('p',attrs={'class':'page'})
if len(tag) == 0:
tag = 'None'
else:
tag = str(tag[0])
pattern = re.compile('>.*<a class=\"current\">')
result = pattern.findall(tag)
if len(result) == 0:
result = 'None'
else:
result = str(result[0])
number = filter(str.isdigit, result)
num = number[5:] #get then total page number
return int(num) def dealthepage(content):
global domain
global cookies
global user_agent
conn = httplib.HTTPConnection(domain)
soup = BeautifulSoup(content)
k = soup.find_all('a')
item = k[27:47]
pattern = re.compile('href=\"(.+?)\"')
hreaf = []
for i in range(len(item)):
ss = pattern.findall(str(item[i]))
if len(ss) == 0:
break
hreaf.append(str(ss[0]))
for i in hreaf:
#sleep(0.5)
conn.request('GET',i,'',{'Cookie':cookies,'User-Agent':user_agent,'Referer':'http://wooyun.org/index.php','Host':'wooyun.org'})
content2 = conn.getresponse()
content2 = content2.read()
soup2 = BeautifulSoup(content2)
imgtag = soup2.find_all(class_='credit')
'''may be $ or cloud'''
if len(imgtag) != 0:
findcloud = re.compile('src=\"\/images\/credit\.png\"')
findmoney = re.compile('src=\"\/images\/m(.?)\.png\"')
cloudnum = findcloud.findall(content2)
moneylevel = findmoney.findall(content2)
cloud = 0
money = 0
if len(cloudnum) != 0:
if len(cloudnum) == 1:
cloud = 1
if len(cloudnum) == 2:
cloud = 2
if len(cloudnum) == 3:
cloud = 3
if len(moneylevel) != 0:
if len(moneylevel) == 1:
money = 1
if len(moneylevel) == 2:
money = 2
if len(moneylevel) == 3:
money = 3
title = soup2.findAll(attrs={"class":"wybug_title"})
if len(title) == 0:
title = 'No Title'
else:
title = str(title[0])
deltag = re.compile('r<[^>]+>')
title = deltag.sub('',title)
author = soup2.findAll(attrs={"class":"wybug_author"})
if len(author) == 0:
author = 'No name'
else:
author = str(author[0])
author = deltag.sub('',author)
date = soup2.findAll(attrs={"class":"wybug_date"})
if len(date) == 0:
date = 'No time'
else:
date = str(date[0])
date = deltag.sub('',date)
link = "http://www.wooyun.org"+i
link = str(link)
f = open("test.html","a+")
s = "<tr><td>level:cloud="+str(cloud)+"money="+str(money)+"</td><th>"+date+"</th><td><a href='"+link+"'>"+title+"</a></td><th>"+author+"</th></tr><br>"
f.write(s)
f.close if __name__ == '__main__':
num = countnumber() #get page num
for i in range(num):
conn = httplib.HTTPConnection(domain)
conn.request('GET','/user.php?action=openbugs&pNO='+str(i+1),'',{'Cookie':cookies,'User-Agent':user_agent,'Referer':'http://wooyun.org/index.php','Host':'wooyun.org'})
content = conn.getresponse()
content = content.read()
dealthepage(content)
附章效果图:
爬取乌云上所有人民币和乌云符号的漏洞(python脚本)的更多相关文章
- 使用python爬取MedSci上的期刊信息
使用python爬取medsci上的期刊信息,通过设定条件,然后获取相应的期刊的的影响因子排名,期刊名称,英文全称和影响因子.主要过程如下: 首先,通过分析网站http://www.medsci.cn ...
- 爬虫入门(三)——动态网页爬取:爬取pexel上的图片
Pexel上有大量精美的图片,没事总想看看有什么好看的自己保存到电脑里可能会很有用 但是一个一个保存当然太麻烦了 所以不如我们写个爬虫吧(๑•̀ㅂ•́)و✧ 一开始学习爬虫的时候希望爬取pexel上的 ...
- Python编写网页爬虫爬取oj上的代码信息
OJ升级,代码可能会丢失. 所以要事先备份. 一開始傻傻的复制粘贴, 后来实在不能忍, 得益于大潇的启示和聪神的原始代码, 网页爬虫走起! 已经有段时间没看Python, 这次网页爬虫的原始代码是 p ...
- steam夏日促销悄然开始,用Python爬取排行榜上的游戏打折信息
前言 本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 不知不觉,一年一度如火如荼的steam夏日促销悄然开始了.每年通过大大小小 ...
- Python爬取网站上面的数据很简单,但是如何爬取APP上面的数据呢
- C# 爬取网页上的数据
最近工作中需求定时爬取不同城市每天的温度.其实就是通过编程的方法去抓取不同网站网页进行分析筛选的过程..NET提供了很多类去访问并获得远程网页的数据,比如WebClient类和HttpWebReque ...
- 爬取 StackOverFlow 上有关于 Python 的问题
给定起始页面以及爬取页数,要求得到每一个问题的标题.票数.回答数.查看数 stackflow <- function(page){ url <- "http://stackove ...
- python爬虫16 | 你,快去试试用多进程的方式重新去爬取豆瓣上的电影
我们在之前的文章谈到了高效爬虫 在 python 中 多线程下的 GIL 锁会让多线程显得有点鸡肋 特别是在 CPU 密集型的代码下 多线程被 GIL 锁搞得效率不高 特别是对于多核的 CPU 来说 ...
- 利用Python爬取OPGG上英雄联盟英雄胜率及选取率信息
一.分析网站内容 本次爬取网站为opgg,网址为:” http://www.op.gg/champion/statistics” 由网站界面可以看出,右侧有英雄的详细信息,以Garen为例,胜率为53 ...
随机推荐
- Linux 虚拟终端:screen
screen 是一个虚拟终端,我们可以把执行时间很长的命令放在虚拟终端中执行,即使终端断开,这个虚拟终端也会在后台执行 [root@localhost ~]$ yum install -y scree ...
- excel——之锁定表头不可编辑
前言: 设置excel表头不可编辑功能.效果如下: 这就意味着,不可随意更改表头数据,除非你有密码. 过程: 1.先随意右键打开一个单元格,查看其中的“设置单元格属性”,即 2.在选中想要编辑的那些数 ...
- VScode之JavaScript Snippet Pack
一个片段包 使用例如: cl 回车或者tab键,就可以完整的打出console.log("") 还有很多快捷功能: 参考: https://marketplace.visualst ...
- WEB安全番外第六篇--关于通过记录渗透工具的Payload来总结和学习测试用例
背景: 在WEB安全的学习过程中,了解过了原理之后,就是学习各种Payload,这里面蕴藏着丰富的知识含量,是在基本上覆盖了漏洞原理之后的进一步深入学习的必经之路.无理是Burpsuite还是Sqlm ...
- Thinkphp --- 去掉index.php
这里我使用的面板是宝塔,操作的 apche: 具体的配置可以参考这里: https://www.cnblogs.com/fangziffff123/p/7588782.html 首先是:Thinkph ...
- 小程序开通微信支付 --- 微信商户平台绑定微信小程序APPID
首先情况是这样的:现有公司有个公众号,已经开通了微信支付(已经有一个商户平台),现在需要开发 微信小程序(也有微信支付),如果在小程序里面重新申请 微信支付,就显得比较麻烦.腾讯官方已经提供了 一个商 ...
- EDT改成CST
功能说明:显示文字.语 法:echo [-ne][字符串]或 echo [--help][--version]补充说明:echo会将输入的字符串送往标准输出.输出的字符串间以空白字符隔开, 并在最后加 ...
- 三维凸包(两个没有公共点)经过旋转平移后使其重心相距最近(POJ3862)
Asteroids Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 481 Accepted: 152 Special ...
- Windows系统下做定时任务为Oracle数据库每天自动备份
1.创建备份目录d:\backup, 创建批处理命令Bak.bat,编写备份脚本 ? 1 2 exp user/passwd@orcl DIRECT=Y BUFFER=100000 FILE=D:\b ...
- 170620、springboot编程之页面版Hello World
书接上回,把Hello World 在页面上显示! 1.在pom文件中加入web支持 <dependency> <groupId>org.springframework.boo ...