英语四六级暴力查询成绩脚本(忘记准考证的同学的好东西)

这几天英语四六级成绩又公报了,又到伤心的时候了。。。。


但这次信心满满的去查成绩,悲剧的事情发生了,准考证号忘了抓狂!!!!!!


难得哥这么勇敢去查成绩,居然忘了,不甘心地写了个暴力查询脚本。。。唉,考级的同学伤不起啊。

以多个线程同时查询,具体操作,在脚本里写得很清楚了。

就怕把主机的服务器查爆了^^为了防止被主机记入黑名单(不知服务器有没有这个判断),所以先设置IP代理,

再去执行脚本。。


#!/bin/bash

#########     四六级暴力查找脚本 ^^   ###############
# by: Leon Lee
###################################################
#如果你能问到与你同考场的人的话,请从E开始看.              #
#准考证共15位.                                      #
#A.前6位是地区号.(可以问与你同一城市报名的任何一人)        #
#B.然后是062 (表示07年的第二次,即07年12月份的)          #
#C.然后是1或2 (1代表四级,2代表6级)                    #
#D.然后的三位是你的考场号,多为0**或1** (自己应该有印象吧) # 
#E.最后两位是你的座位号, 也应该能记住吧!                # 
##################################################

#地区号+年月+四六级
cetID=430601111

#################################################################
#你的名字的前两位编码,不知道的可以在百度搜索你名字
#的前两位,然后看地置栏wd=*****
#
#例如:名字叫张三丰,那么在百度里搜 张三
#这里看看百度上的地址栏就会变为
#http://www.baidu.com/s?wd=%D5%C5%C8%FD&rsv_bp=0&n=2&inputT=966
#
#     %D5%C5%C8%FD   这个就是张三的编码
#
MyName="%D5%C5%C8%FD"
################################################################

################  查询结果的保存位置     ##################
RESULT_PATH=~/cetlist
########################################################



######### 根据你的需要去修改   ############
#这里从第1个考场座位为1号的开始查询
let startid=100101
#这里从300考场55座位号结束
let endid=130055
#######################################

function initWork {
	let allID=$endid-$startid
	if [ $allID -ge 30000 ]
	then
	let thread=10
	elif [ $allID -ge 5000 ]
	then
	let thread=8
	elif [ $allID -ge 50 ]
	then
	let thread=5
	elif [ $allID -ge 10 ]
	then
	let thread=2
	else
	let thread=1
	fi
	let temp=($endid-$startid)/$thread
	
	echo "The results:" > $RESULT_PATH
}

function doWork {
	
	for i in $(seq $tempID $tempEndID)
	do
		let rem=$i%100
		if [ $rem -ge 40 ]
		then
		continue
		else
		echo "正在查询${i}"
		check=`curl --verbose --data "id=${cetID}${i}&name=${MyName}" --header "Referer: http://cet.99sushe.com/" "http://cet.99sushe.com/s"` 
		if [ ! -z $check ];then
		echo "哈哈哈,找到了。。CETID=${cetID}${i}"
		echo "${cetID}${i} ${check}" >> $RESULT_PATH
		fi
		fi
	done
}

function main {
	#多线程查询
	for i in $(seq $thread)
	do
		echo "启动第${i}条线程"
		if [ $i == 1 ]
		then
		let tempID=$startid
		else
		let tempID=$tempEndID+1
		fi

		if [ $i == $thread ]
		then
		let tempEndID=$endid
		else
		let tempEndID=$tempID+$temp
		fi

		doWork &
	done
}
initWork
sleep 1
main


先预祝大家考试通过咯^^

转载于:https://my.oschina.net/lendylongli/blog/226767

猜你喜欢

转载自blog.csdn.net/weixin_33827590/article/details/92576631