笔者最近入读某大学珠海校区。为了给自己众多不能进行 Web Portal 认证的设备分享网络,折腾了几天找了网上现成的几个方案。
1. 自动登录
1.1. Portal 方案(HTTP 网页认证)
不推荐此方案,因为不安全。但它同时适用于无线中继和有线网络——如果你不想使用有线网络接入,请选择此方案。
Steve0x2a/JNU_ZH_Network: 暨南大学珠海校区有线网认证
1.2. iNode 有线网络认证
1.2.1. njit-client
经过测试,珠区不可用。会因为未知的原因卡在 [ ] Client: Start。其他学校可以先试试这个,不行再换 c3h-client。
编译好的 OpenWRT 软件包: 【h3c校园网认证】njit-client 2.0(支持inode 7.1)-H3C新华三网络设备-恩山无线论坛
另一个实现: Besfim/inode-njit: A iNode 802.1x client
Reference: 暨南大学珠海校区校园网 – 802.1x Linux 客户端
1.2.2. c3h-client (推荐)
经过测试,珠区可用。该软件采用漏洞绕过客户端完整性检测。
mcdona1d/c3h-client: H3C 802.1x客户端
2. 多设备检测绕过
目前似乎没有遇到因为多设备连接而被踢下线的情况,但仍然把查到的资料集合在这里备用。
2.1. 杂项检测——TTL, NTP, Flash
#! /bin/sh
echo ---TTL---
iptables -t mangle -A POSTROUTING -j TTL --ttl-set 128 # 64-Linux, 128-Windows
echo ---NTP---
iptables -t nat -N ntp_force_local
iptables -t nat -I PREROUTING -p udp --dport 123 -j ntp_force_local
iptables -t nat -A ntp_force_local -d 0.0.0.0/8 -j RETURN
iptables -t nat -A ntp_force_local -d 127.0.0.0/8 -j RETURN
iptables -t nat -A ntp_force_local -d 192.168.15.0/16 -j RETURN
iptables -t nat -A ntp_force_local -s 192.168.15.0/16 -j DNAT --to-destination 192.168.15.1
# echo ---Flash---
# iptables -I FORWARD -p tcp --sport 80 --tcp-flags ACK ACK -m string --algo bm --string " src=\"http://1.1.1." -j DROP
2.2. UA 检测
2.2.1. UA2F 方案
直接安装即可。但由于我的路由器固件编译时没有加上相应内核模块,无法使用 UA2F。(懒属性大爆发)
2.2.2. UA3F 方案
先安装 UA3F:
然后需要把流量转发到 UA3F 的服务端口上。由于我没有代理需求,所以选择 ipt2socks + iptables 进行转发。
zfl9/ipt2socks: 将 iptables/nftables 传入的透明代理流量转为 socks5 流量的实用工具
然后书写启动脚本:
#! /bin/sh
# ---Ulimit---
mkdir -p /etc/security
echo "* hard nofile 655360" > /etc/security/limits.conf; echo "* soft nofile 655360" >> /etc/security/limits.conf
sysctl -w fs.file-max=655360; sysctl -w fs.nr_open=655360; sysctl -p
ulimit -n 655360
echo ---UA3F---
service ua3f status || (echo "[PANIC] ua3f not installed."; exit 1)
service ua3f stop
uci set ua3f.enabled.enabled='1'; uci set ua3f.main.bind='0.0.0.0'; uci set ua3f.main.port='14480'; uci set ua3f.main.ua='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.51'; uci commit ua3f
service ua3f start
echo ---ipt2socks---
killall ipt2socks
ipt2socks -s 127.0.0.1 -p 14480 > /dev/null 2>/dev/null &
iptables -F; iptables -X; iptables -Z; iptables -t nat -F; iptables -t nat -X; iptables -t nat -Z
iptables -t nat -N ipt2socks
iptables -t nat -A ipt2socks -d 0.0.0.0/8 -j RETURN
iptables -t nat -A ipt2socks -d 10.0.0.0/8 -j RETURN
iptables -t nat -A ipt2socks -d 127.0.0.0/8 -j RETURN
iptables -t nat -A ipt2socks -d 169.254.0.0/16 -j RETURN
iptables -t nat -A ipt2socks -d 172.16.0.0/12 -j RETURN
iptables -t nat -A ipt2socks -d 192.168.0.0/16 -j RETURN
iptables -t nat -A ipt2socks -d 224.0.0.0/4 -j RETURN
iptables -t nat -A ipt2socks -d 240.0.0.0/4 -j RETURN
iptables -t nat -A ipt2socks -d 100.64.0.0/10 -j RETURN
iptables -t nat -A ipt2socks -p tcp -j REDIRECT --to-ports 60080
iptables -t nat -A PREROUTING -p tcp -j ipt2socks
iptables -t nat -A OUTPUT -p tcp -j ipt2socks
如此便可以绕过 UA 检测。但是注意,该方案会消耗大量系统资源,如果你的路由器性能较差,容易在并发数太大时死机。
3. 多拨
待补充……其实是因为我也不会(小小声)
Loading Comment Component...
