DISCUE盖楼器

package com.soft.hr.per.service;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

/**
* CrashForm.java
*

*
* Modification History:

* Date Author Description

* ------------------------------------------------------------------

* Oct 23, 2013 new

*/
public class CopyOfCrashForm {

public static void main(String[] args) throws ClientProtocolException, IOException {
HttpClient client = new DefaultHttpClient();
HttpPost httpost = new HttpPost(
"http://172.20.32.66/member.php?mod=logging&action=login&loginsubmit=yes&handlekey=login&loginhash=Lln4l");
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("username", "--"));
// nvps.add(new BasicNameValuePair("ticket2", "hy2012"));
nvps.add(new BasicNameValuePair("password", "--"));
httpost.setEntity(new UrlEncodedFormEntity(nvps, "GBK"));
HttpResponse response = client.execute(httpost);
// System.out.println(EntityUtils.toString(response.getEntity()) +
// "--");
httpost.abort();
HttpGet httget = new HttpGet("http://172.20.32.66/forum.php?mod=viewthread&tid=1587&page=1#pid9397");
HttpResponse response2 = client.execute(httget);
//System.out.println(EntityUtils.toString(response2.getEntity()) + "--");

Document doc = Jsoup.parse(EntityUtils.toString(response2.getEntity()));
//System.out.println(doc.html());
String formhash = doc.select("input[name=formhash]").val();
long posttime = Long.valueOf(doc.select("input[name=posttime]").val());
System.out.println(formhash+"--"+posttime);

httget.abort();
String message="olala,加油↖(^ω^)↗";
//forum.php?mod=post&action=reply&fid=31&tid=1583&extra=&replysubmit=yes&infloat=yes&handlekey=fastpost
for (int i = 1; i < 100000; i++) {

HttpPost h2 = new HttpPost(
"http://172.20.32.66/forum.php?mod=post&action=reply&fid=31&tid=1587&extra=&replysubmit=yes&infloat=yes&handlekey=fastpost");

List<NameValuePair> invps = new ArrayList<NameValuePair>();

invps.add(new BasicNameValuePair("message", message+i));
invps.add(new BasicNameValuePair("formhash", formhash));
invps.add(new BasicNameValuePair("posttime", posttime+""));
posttime+=6000;
invps.add(new BasicNameValuePair("usesig", "1"));
invps.add(new BasicNameValuePair("subject", " "));
// invps.add(new BasicNameValuePair("referer",
// "http://172.20.32.66/forum.php?mod=post&action=reply&fid=61&tid=1584"));
// nvps.add(new BasicNameValuePair("ticket2", "hy2012"));

h2.setEntity(new UrlEncodedFormEntity(invps, "GBK"));
HttpResponse iresponse = client.execute(h2);
System.out.println(EntityUtils.toString(iresponse.getEntity()) + "--");
h2.abort();
}
}
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值