基于Linux的校园网破解思路和方法 您所在的位置:网站首页 破解校园网时间限制 基于Linux的校园网破解思路和方法

基于Linux的校园网破解思路和方法

2024-02-20 05:41| 来源: 网络整理| 查看: 265

#思路: ##1、 当校园网断开,只需要重新拨号即可 ##2、 校园网使用两台电脑同时登录时不会立即下线,其中有一段时间间隔

 

#步骤: ##1、 通过抓包对拨号产生的数据包进行分析,使得可以通过代码来实现自动拨号

脚本一(login.sh):

#!/bin/bash # check Internet status sleep 20 ping -c 1 114.114.114.114 > /dev/null 2>&1 if [ $? -eq 0 ];then logger Connecting. else logger Network disconnection. source ./login.sh # 等价于 ../login.sh 使用source调用脚本不会退出当前脚本 logger Reconnecting.

这个脚本的作用是用于断网检测

 

脚本二(check_net.sh):

#!/bin/bash logger "[Dr.com page verify] Start timing detection." curl http://192.168.167.46 >drcom.html check_status=`grep "Dr.COMWebLoginID_0.htm" drcom.html` if [[ $check_status != "" ]] then # offline status logger "[Dr.com page verify] offline status." # yourself curl curl -X POST "http://192.168.167.46/a70.htm" -H "Origin: http://192.168.167.46" -H "Connection: keep-a live" -H "Content-Type: application/x-www-form-urlencoded" -H "Upgrade-Insecure-Requests: 1" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.170 Safari/537.36" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3" -H "DNT: 1" -H "http://192.168.167.46/a70.htm?wlanacip=null&wlanacname=null&vlanid=0&ssid=null&areaID=null&mac=00-00-00-00-00-00" -H "Accept-Encoding: gzip, deflate" -H "Accept-Language: zh-CN,zh;q=0.9" -b "program=ip; vlan=0; ip=10.73.42.253; md5_login2=1809111038%7C284974" --data "DDDDD=1809111038&upass=284974&R1=0&R2=&R6=0¶=00&0MKKey=123456&buttonClicked=&redirect_url=&err_flag=&username=&password=&user=&cmd=&Login=&R7=0" --tlsv1 -o Sxinfo.txt logger "[Dr.com page verify] online status." else # always online logger "[Dr.com page verify] already onine." fi   ##2、 如果需要实现多台电脑同时在线,就需要在校园网还没检测并下线之前重新拨号

对于上面的脚本进行任务计划,将时间间隔设置在11秒(防止拨号频繁被禁)

*/1 * * * * sleep 11 && /etc/storage/login.sh */1 * * * * sleep 23 && /etc/storage/login.sh */1 * * * * sleep 35 && /etc/storage/login.sh */1 * * * * sleep 47 && /etc/storage/login.sh */1 * * * * sleep 58 && /etc/storage/login.sh

 

#优化: ##1、 不知道为啥,校园网偶尔需要重新拨号,所以我写了一个脚本来以防万一;     并且把计划任务自动化,因为一停电路由器就会初始化=,=    

ps:来自一个月后的我终于知道了,把脚本放到etc下就不会因为断电重启刷掉了

脚本三:

#!/bin/bash a=`wc -l /etc/storage/cron/crontabs/admin |awk 'BEGINF{FS=""}{print $1}'` b=7 c=`ping -c 3 www.baidu.com | grep loss | awk 'BEGIN{FS=","} {print $3}'| awk 'BEGIN{FS="%"} {print $1}'` d=0 if [ a!=b ];then   rm -rf /home/root/admin   echo "*/1 0-23 * * 1-7 /etc/storage/check_net.sh" >>/home/root/admin   echo "*/1 * * * * sleep 11 && /etc/storage/login.sh" >>/home/root/admin   echo "*/1 * * * * sleep 23 && /etc/storage/login.sh" >>/home/root/admin   echo "*/1 * * * * sleep 35 && /etc/storage/login.sh" >>/home/root/admin   echo "*/1 * * * * sleep 47 && /etc/storage/login.sh" >>/home/root/admin   echo "*/1 * * * * sleep 58 && /etc/storage/login.sh" >>/home/root/admin   echo "*/1 0-23 * * 1-7 /home/root/test.sh" >>/home/root/admin   rm -rf /etc/storage/cron/crontabs/admin   mv /home/root/admin /etc/storage/cron/crontabs/     if [ c!=d ];then       sh /etc/storage/login.sh     fi fi

 

*注:主要作用就是

  1、检查计划任务是不是正常的,不是就重新写入。

  2、ping一下百度,要是没有ping通就重新执行一下脚本(这个脚本我给他设置的计划任务时间间隔是一分钟)

 

#自动化脚本:

接下来是重头戏,因为需要帮其他同学搞所以我就把所有脚本写一起了,经过几次的迭代优化。可能还是会有一些小毛病。

 

#!/bin/bash while true do clear echo "菜单" echo "1 检测网络" echo "2 清理计划任务" echo "3 部署破解脚本" echo "4 退出脚本" read -p "请选择模式:" mode case $mode in 1) echo "您选择了模式1-检测网络" echo "正在为您检测网络" a=`ping -c 3 www.baidu.com | grep loss | awk 'BEGIN{FS=","} {print $3}'| awk 'BEGIN{FS="%"} {print $1}'` b=0 if [ $a == $b ];then #echo "您的网络正常" echo -e "\033[32m 您的网络正常 \033[0m" else #echo "阿哦?! 网络好像出了一点问题" echo -e "\033[31m 阿哦?! 网络好像出了一点问题 \033[0m" fi sleep 3s ;; 2) clear echo"您选择了模式2-清理计划任务" echo "正在为您清理计划任务" mv /etc/storage/cron/crontab/admin /etc/storage/cron/crontab/admin.bak echo "正在为您备份原计划任务" echo "已为您将原任务计划备份至/etc/storage/cron/crontab/admin.bak" echo "#test" > /etc/storage/test.sh mv /etc/storage/test.sh /etc/storage/cron/crontab/admin echo -e "\033[32m 任务计划清理完成 \033[0m" #echo "任务计划清理完成" slepp 3s ;; 3) echo"您选择了模式3-部署破解脚本" echo"请按要求输入学号和密码" read -p "请输入学号:" uid read -p "请输入身份证后六位:" cipeher clear echo"正在部署登录脚本" echo '\#!/bin/bash' >>/etc/storage/check_net.sh echo 'logger "[Dr.com page verify] Start timing detection."' >>/etc/storage/check_net.sh echo 'curl http://192.168.167.46 >drcom.html' >>/etc/storage/check_net.sh echo 'check_status=`grep "Dr.COMWebLoginID_0.htm" drcom.html`' >>/etc/storage/check_net.sh echo 'if [[ $check_status != "" ]]' >>/etc/storage/check_net.sh echo 'then' >>/etc/storage/check_net.sh echo ' \# offline status' >>/etc/storage/check_net.sh echo ' logger "[Dr.com page verify] offline status."' >>/etc/storage/check_net.sh echo 'curl -X POST "http://192.168.167.46/a70.htm" -H "Origin: http://192.168.167.46" -H "Connection: keep-a' >>/etc/storage/check_net.sh echo "live\" -H \"Content-Type: application/x-www-form-urlencoded\" -H \"Upgrade-Insecure-Requests: 1\" -H \"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.170 Safari/537.36\" -H \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3\" -H \"DNT: 1\" -H \"http://192.168.167.46/a70.htm?wlanacip=null&wlanacname=null&vlanid=0&ssid=null&areaID=null&mac=00-00-00-00-00-00\" -H \"Accept-Encoding: gzip, deflate\" -H \"Accept-Language: zh-CN,zh\;q=0.9\" \-b \"program=ip; vlan=0; ip=10.73.42.253; md5_login2=$uid%7C$cipeher--data \"DDDDD=$uid&upass=$cipeher R1=0&R2=&R6=0¶=00&0MKKey=123456&buttonClicked=&redirect_url=&err_flag=&username=&password=&user=&cmd=&Login=&R7=0" --tlsv1 -o Sxinfo.txt logger "[Dr.com page verify] online status." >>/etc/storage/check_net.sh echo 'else' >>/etc/storage/check_net.sh echo ' logger "[Dr.com page verify] already onine."' >>/etc/storage/check_net.sh echo 'fi' >>/etc/storage/check_net.sh chmod +x /etc/storage/check_net.sh #echo"已成功部署check_net脚本 还剩 66.6%" echo -e "\033[32m 已成功部署check_net脚本 还剩 66.6% \033[0m" clear echo "正在部署原计划任务脚本" echo '#!/bin/bash' > /etc/storage/login.sh echo 'sleep 20' >> /etc/storage/login.sh echo 'ping -c 1 114.114.114.114 > /dev/null 2>&1' >> /etc/storage/login.sh echo 'if [ $? -eq 0 ];then' >> /etc/storage/login.sh echo 'logger Connecting.' >> /etc/storage/login.sh echo 'else' >> /etc/storage/login.sh echo 'logger Network disconnection.' >> /etc/storage/login.sh echo 'source ./login.sh' >> /etc/storage/login.sh echo 'logger Reconnecting.' >> /etc/storage/login.sh chmod +x /etc/storage/login.sh #echo"已成功部署login.sh脚本 还剩 33.3%" echo -e "\033[32m 已成功部署login.sh脚本 还剩 33.3% \033[0m" clear echo "正在部署新计划任务脚本" echo '#!/bin/bash' > /etc/storage/test.sh echo 'a=`wc -l /etc/storage/cron/crontabs/admin |awk 'BEGINF{FS=""}{print $1}'`' >> /etc/storage/test.sh echo 'b=7' >> /etc/storage/test.sh echo 'c=`ping -c 3 www.baidu.com | grep loss | awk 'BEGIN{FS=","} {print $3}'| awk 'BEGIN{FS="%"} {print $1}'`' >> /etc/storage/test.sh echo 'd=0' >> /etc/storage/test.sh echo 'if [ $a != $b ];then' >> /etc/storage/test.sh echo 'rm -rf /etc/storage/admin' >> /etc/storage/test.sh echo 'echo "*/1 0-23 * * 1-7 /etc/storage/check_net.sh" >>etc/storage/admin' >> /etc/storage/test.sh echo 'echo "*/1 * * * * sleep 11 && /etc/storage/login.sh" >>etc/storage/admin' >> /etc/storage/test.sh echo 'echo "*/1 * * * * sleep 23 && /etc/storage/login.sh" >>etc/storage/admin' >> /etc/storage/test.sh echo 'echo "*/1 * * * * sleep 35 && /etc/storage/login.sh" >>etc/storage/admin' >> /etc/storage/test.sh echo 'echo "*/1 * * * * sleep 47 && /etc/storage/login.sh" >>etc/storage/admin' >> /etc/storage/test.sh echo 'echo "*/1 * * * * sleep 58 && /etc/storage/login.sh" >>etc/storage/admin' >> /etc/storage/test.sh echo 'echo "*/1 0-23 * * 1-7 /etc/storage/test.sh" >>/etc/storage/admin' >> /etc/storage/test.sh echo 'mv /etc/storage/cron/crontabs/admin /etc/storage/cron/crontabs/admin.bak' >> /etc/storage/test.sh echo 'mv /etc/storage/admin /etc/storage/cron/crontabs/' >> /etc/storage/test.sh echo 'if [ $c!= $d ];then ' >> /etc/storage/test.sh echo 'sh /etc/storage/login.sh' >> /etc/storage/test.sh echo 'fi' >> /etc/storage/test.sh echo 'fi' >> /etc/storage/test.sh chmod +x /etc/storage/test.sh echo -e "\033[32m 已成功部署全部脚本 \033[0m" #echo"已成功部署全部脚本" echo"正在激活脚本" sh /etc/storage/test.sh echo"已为您激活脚本" sleep 3s ;; 4) break ;; *) echo "输入模式编号错误" esac done

 



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有