本人所在学校采用的是Srun3000深澜系统进行的网络认证,在参考了北航srun3000客户端python版,将认证登录的代码改成了HTML版。最开始只有IPv4版,在@李玉贤 和 @张嘉琦 等人的帮助下添加了IPv6登录。如果不是地大的话记得将login的IP地址改成自己学校的就好了。
P.S.测试了在Windows和Linux平台IPv4和IPv6都可用!
复制下面的代码保存为"ipv4.html",记得将自己的账号密码和MAC地址填写进去,MAC地址的格式为aa:bb:cc:dd,全部为小写。
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>Srun Login!</title>
<script type="text/javascript">
function submit() {
document.getElementById('submit1').click();
}
</script>
</head>
<body onload="submit();">
<form action="http://202.204.105.195:3333/cgi-bin/do_login" method="post">
<!--将账号,密码,MAC地址分别填写进value=""的俩冒号中,例如value="1234567"-->
<p>账号:<input name="username" value=""></p>
<p>密码:<input type="password" name="password" value=""></p>
<p>MAC:<input name="mac" type="hidden" value=""></p>
<input name="n" type="hidden" value="99">
<input name="type" type="hidden" value="3">
<p><input type="submit" id="submit1" value="OK" /></p>
</form>
</body>
</html>
复制下面的代码保存为"ipv6.html",记得将自己的账号密码填写进去
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>Srun Login!</title>
<script type="text/javascript">
function submit() {
document.getElementById('submit2').click();
}
</script>
</head>
<body onload="submit();">
<form action="http://[2001:da8:214:102:d6be:d9ff:feaa:422a]/cgi-bin/do_login" method="post">
<!--将账号,密码,MAC地址分别填写进value=""的俩冒号中,例如value="1234567"-->
<p>账号:<input name="username" value=""></p>
<p>密码:<input type="password" name="password" value=""></p>
<input name="n" type="hidden" value="100">
<input name="is_pad" value="1">
<input name="type" type="hidden" value="1">
<p><input type="submit" id="submit2" value="OK" /></p>
</form>
</body>
</html>
复制下面的代码保存为"login.html"
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>Srun Login!</title>
<style type="text/css">
iframe {
border:none;
width:100%;
display:block;
}
</style>
</head>
<body>
<iframe src="ipv6.html">
</iframe>
<iframe src="ipv4.html">
</iframe>
</body>
</html>
保证三个文件在同一文件夹下,资料全部填写进去之后,打开login.html即可完成登录过程。