关于暴力破解软考成绩查询(忘了准考证号)的实例

2012年上半年软考成绩出来了很久了 可是我忘了准考证号  又过了复查准考证号日期  于是看了成绩查询的界面源码 发现成绩查询的步骤非常简单 于是想通过java模拟表单提交找出自己的准考证号 附上源码参考

 

public class TestMain {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
	
		MyInt myInt = new MyInt("211523000000");
		while(!getResult(myInt)){
			myInt.add();
			System.out.println(myInt);
		}
		System.out.println(myInt);
	}

	public static boolean getResult(MyInt myInt) {
		DefaultHttpClient mHttpclient = new DefaultHttpClient();
		HttpPost post = new HttpPost(
				"http://www.hbsoft.net/ws/chafen/result.asp");
		List<NameValuePair> mParams = new ArrayList<NameValuePair>();
		mParams.add(new BasicNameValuePair("zhunkaozheng", myInt.toString()));
		mParams.add(new BasicNameValuePair("shenfenzheng", "*********************"));//此处输入自己的身份证号码
		mParams.add(new BasicNameValuePair("fbi", "fbi"));
		try {
			post.setEntity(new UrlEncodedFormEntity(mParams, HTTP.UTF_8));
			HttpResponse mResponse = mHttpclient.execute(post);
			BufferedReader reader = new BufferedReader(new InputStreamReader(
					mResponse.getEntity().getContent(), "gbk"));
			int i = 0;
			while (i != 210) {
				i++;
				reader.readLine();
			}
			String line = reader.readLine();
			if (line.contains("没有与您输入的号码相匹配的信息")) {
				//System.out.println(line);
				return false;
			}
			System.out.println(line);
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ClientProtocolException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return true;

	}

	public static class MyInt {
		int[] numbers;

		public MyInt() {
			numbers = new int[12];
			for (int i = 0; i < numbers.length; i++) {
				numbers[i] = 0;
			}
		}
		public MyInt(String numbers_str) {
			numbers = new int[12];
			for (int i = 0; i < numbers.length; i++) {
				numbers[i] = Integer.parseInt(numbers_str.substring(i, i+1));
			}
		}

		public void add() {
			add(numbers.length - 1);
		}

		private void add(int i) {
			if (i > 0) {
				numbers[i]++;
				if (numbers[i] == 10) {
					numbers[i] = 0;
					i--;
					add(i);
				}
			} else {
				if (numbers[i] == 9) {
					return;
				}
				numbers[i]++;
			}
		}
		
		public String toString() {
			String line = "";
			for(int i = 0 ; i < numbers.length ; i++) {
				line = line + String.valueOf(numbers[i]);
			}
			return line;
		}
	}
}
 

 

为什么从211542000000开始 大家可以参考准考证号的生成格式:http://www.233.com/soft/zixun/dynamic/guangdong/20100810/112653644.html 

或者参考一下同学的格式 一般前六位是一样的

 

我两天试了近30000个帐号 但最后还是找出了自己的准考证发现 一开始自己设置的格式有些不一样 所以功夫白费了 但感觉这个过程还是挺有趣的  呵呵!  

 

本例可献给那些准考证真的掉了 且真的不记得帐号的朋友借鉴实验! 有什么不妥的地方 见谅哈

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值