小熊の小站

Try my best.

校园网登入一键脚本分享

Littlebear0729's Avatar 2023-10-30 折腾记

适用于宿舍楼新装的光猫(wifi的ssid名称为bjut-sushe-(2.4G/5G)-XXXX),原来需要在 ‘http://10.21.221.98/a79.htm‘ 和 ‘lgn.bjut.edu.cn’ 分别登录两次,现在登录一次就可以了。

我的电脑是mac,所以写了个sh脚本。

1
2
3
4
5
6
7
# fill your username and password
username=20123456
password=THISisYOURpassword

# the specific IP addr will be logged in, which means you can login other's device by IP addr.
ip=`ifconfig en0 | grep 'inet ' | awk '{print $2}'`
curl "http://10.21.221.98:801/eportal/portal/login?callback=dr1003&login_method=1&user_account=$username%40campus&user_password=$password&wlan_user_ip=$ip&wlan_user_ipv6=&wlan_user_mac=000000000000&wlan_ac_ip=&wlan_ac_name=&jsVersion=4.2.1&terminal_type=3&lang=zh-cn&v=4344&lang=zh"

脚本分享在我的gist上面:https://gist.github.com/littlebear0729/730444f2e094bb520cab25d60092b177

新认证平台有一个很有意思的地方,就是可以为某一个ip进行登录。这就意味着如果你知道别的设备的ip,你可以为其他设备登录。

本文作者 : Littlebear0729
本文使用 署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 协议
本文链接 : https://blog.bearxiong.xyz/2023/10/%E6%A0%A1%E5%9B%AD%E7%BD%91%E7%99%BB%E5%85%A5%E4%B8%80%E9%94%AE%E8%84%9A%E6%9C%AC%E5%88%86%E4%BA%AB-1/

本文最后更新于 天前,文中所描述的信息可能已发生改变