页面小偷程序入门

简单的身份证偷取:

<%@ page import="java.io.*,java.net.*,java.util.regex.*"%>
<%@ page import="org.apache.commons.httpclient.HttpClient"%>
<%@ page import="org.apache.commons.httpclient.NameValuePair"%>
<%@ page import="org.apache.commons.httpclient.methods.PostMethod"%>
<%@ page import="com.meterware.httpunit.HttpException"%>

 

<%

request.setCharacterEncoding("utf-8");
 String uid = request.getParameter("userid");
 
 //URL url = new URL("http://wap.ip138.com/id.wml");  
 String temp = "服务器访问繁忙, 请待会进来<br/>";
 HttpClient client = new HttpClient();
  PostMethod authpost = new PostMethod(
  "http://wap.ip138.com/id.asp");
  NameValuePair userid = new NameValuePair("userid",
    uid);
  authpost.setRequestBody(new NameValuePair[] { userid});
  try {
   client.executeMethod(authpost);
  } catch (HttpException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  } catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
  String originalData = "";
  originalData=authpost.getResponseBodyAsString();
  authpost.releaseConnection(); 

  if (originalData.indexOf("<p>") != -1)
   temp = originalData.substring(originalData.indexOf("<p>") + 3, originalData.length());
  else if (originalData.indexOf("<p align") != -1) {
   temp = originalData.substring(originalData.indexOf("<p"), originalData.length());
   temp = temp.substring(temp.indexOf(">")+1, temp.length());
  } 
  temp = temp.substring(0, temp.indexOf("(c)"));

 

%>

<%

       out.println(temp); 

%>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值