Mmx233 / BitSrunLoginGo

深澜校园网登录程序 Go 语言版,适用于Windows、Linux、路由器等。提供对 Docker、Go Module、OpenWrt 的支持
GNU Affero General Public License v3.0
303 stars 27 forks source link

rr_code=2,不知道为啥输入的网址在运行后会多加/cgi-bin/srun_portal ,用浏览器进入http://172.31.252.106/cgi-bin/rad_user_info 也是空的,不知道是不是程序给网址加了这一段导致的 #31

Closed KristianLi closed 6 months ago

KristianLi commented 6 months ago

DEBU[0000] 正在获取登录状态
DEBU[0000] HTTP GET http://172.31.252.106/cgi-bin/rad_user_info DEBU[0000] jQuery446124185672941558877_1711128758304({"client_ip":"36.248.206.108","ecode":0,"error":"not_online_error","error_msg":"","online_ip":"36.248.206.108","res":"not_online_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20230324","st":1711128758}) DEBU[0000] 认证客户端 ip: 36.248.206.108
INFO[0000] 检测到用户未登录,开始尝试登录...
DEBU[0000] 正在获取 Token
DEBU[0000] HTTP GET http://172.31.252.106/cgi-bin/get_challenge DEBU[0000] jQuery224352463733694157345_1711128758313({"challenge":"7c071bde0766ced20007f4ce9afb850153e0839f8b770222f69dcf152200aed6","client_ip":"36.248.206.108","ecode":0,"error":"ok","error_msg":"","expire":"60","online_ip":"36.248.206.108","res":"ok","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20230324","st":1711128758}) DEBU[0000] token: 7c071bde0766ced20007f4ce9afb850153e0839f8b770222f69dcf152200aed6 DEBU[0000] 发送登录请求
DEBU[0000] HTTP GET http://172.31.252.106/cgi-bin/srun_portal DEBU[0000] jQuery253619995829737274899_1711128758323({"client_ip":"36.248.206.108","ecode":"","error":"login_error","error_msg":"INFO Error锛宔rr_code=2","online_ip":"36.248.206.108","res":"login_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20230324","st":1711128758}) ERRO[0000] 登录出错: login_error

Mmx233 commented 6 months ago

尝试把 reality 设为 true 或仔细检查 meta 值

KristianLi commented 6 months ago

尝试把 reality 设为 true 或仔细检查 meta 值

reality是true meta设置如下,已知acid肯定是对的 "n": "200" type: "1" acid: "13" enc: srun_bx1 os: Windows 10 name: windows info_prefix: SRBX1 double_stack: false

以下是完整报错: root@OpenWrt:~# bitsrunlogin-go INFO[0000] [以守护模式启动]
DEBU[0000] 开始 Reality 流程
DEBU[0000] HTTP GET http://100.87.128.1
DEBU[0000] HTTP GET http://172.31.252.106/index_13.html?wlanuserip=100.87.173.24&wlanacname= DEBU[0000] HTTP GET http://172.31.252.106/srun_portal_pc?ac_id=13&theme=pro&wlanacname=&wlanuserip=100.87.173.24 DEBU[0000] 正在获取登录状态
DEBU[0000] HTTP GET http://172.31.252.106/cgi-bin/rad_user_info DEBU[0000] jQuery416828174843435415217_1711130416883({"client_ip":"36.248.206.108","ecode":0,"error":"not_online_error","error_msg":"","online_ip":"36.248.206.108","res":"not_online_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20230324","st":1711130416}) DEBU[0000] 认证客户端 ip: 36.248.206.108
INFO[0000] 检测到用户未登录,开始尝试登录...
DEBU[0000] 正在获取 Token
DEBU[0000] HTTP GET http://172.31.252.106/cgi-bin/get_challenge DEBU[0000] jQuery929182861274792868583_1711130416892({"challenge":"df4ecc0292f4cfdb9185eec9b3563e1045baeb369bf0728bf767cf3b9db24881","client_ip":"36.248.206.108","ecode":0,"error":"ok","error_msg":"","expire":"60","online_ip":"36.248.206.108","res":"ok","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20230324","st":1711130416}) DEBU[0000] token: df4ecc0292f4cfdb9185eec9b3563e1045baeb369bf0728bf767cf3b9db24881 DEBU[0000] 发送登录请求
DEBU[0000] HTTP GET http://172.31.252.106/cgi-bin/srun_portal DEBU[0000] jQuery783791579135572772547_1711130416901({"client_ip":"36.248.206.108","ecode":"","error":"login_error","error_msg":"INFO Error锛宔rr_code=2","online_ip":"36.248.206.108","res":"login_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20230324","st":1711130417}) ERRO[0000] 登录出错: login_error

Mmx233 commented 6 months ago

目前的信息很难推断问题出在哪,不过就使用经验来说这个报错在 user type 不对的时候会出现。鉴于以前有文档出错的情况,请不要复制使用 readme 的示例配置

KristianLi commented 6 months ago

目前的信息很难推断问题出在哪,不过就使用经验来说这个报错在 user type 不对的时候会出现。鉴于以前有文档出错的情况,请不要复制使用 readme 的示例配置

使用的是自动生成的Config然后改URL账号密码啥的,不是复制的reademe,我试试修改type的值,感谢大佬这么晚还在回复!

KristianLi commented 6 months ago

根据登陆成功的抓包,n=200 type=1 acid=13都是符合的,在电脑上使用python模拟点击登陆也是ok的,不知道是不是该程序被检测到了

Mmx233 commented 6 months ago

能否发一份 jquery.srun.portal.js 给我看看

KristianLi commented 6 months ago

我正在尝试发到您写在github上的邮箱,但是似乎gmail不让加上js附件这里显示可能带毒,我再试试qq邮箱

KristianLi commented 6 months ago

已发送

Mmx233 commented 6 months ago

认证逻辑是一样的,大概率是配置问题

Mmx233 commented 6 months ago

我发现登录逻辑的 md5 算法使用的是旧版逻辑,SRUN V1.18 B20240324 可能已经移除了旧版兼容,请你尝试使用此条消息附件的 binary 看看能不能登录

bitsrun_linux_mipsle.zip bitsrun_linux_386.zip bitsrun_linux_mips64le_softfloat.zip bitsrun_linux_mipsle_softfloat.zip bitsrun_linux_arm.zip bitsrun_aix_ppc64.zip bitsrun_freebsd_arm.zip bitsrun_freebsd_386.zip bitsrun_windows_arm64.zip bitsrun_openbsd_arm64.zip bitsrun_openbsd_amd64.zip bitsrun_netbsd_arm64.zip bitsrun_freebsd_amd64.zip bitsrun_netbsd_arm.zip bitsrun_netbsd_amd64.zip bitsrun_windows_arm.zip bitsrun_freebsd_arm64.zip bitsrun_netbsd_386.zip bitsrun_windows_386.zip bitsrun_openbsd_386.zip bitsrun_openbsd_arm.zip bitsrun_illumos_amd64.zip bitsrun_plan9_amd64.zip bitsrun_darwin_arm64.zip bitsrun_plan9_arm.zip bitsrun_plan9_386.zip bitsrun_windows_amd64.zip bitsrun_js_wasm.zip bitsrun_linux_s390x.zip bitsrun_darwin_amd64.zip bitsrun_linux_amd64.zip bitsrun_linux_riscv64.zip bitsrun_linux_mips.zip bitsrun_linux_ppc64.zip bitsrun_linux_arm64.zip bitsrun_linux_mips_softfloat.zip bitsrun_linux_mips64_softfloat.zip bitsrun_dragonfly_amd64.zip bitsrun_solaris_amd64.zip bitsrun_linux_mips64le.zip bitsrun_linux_ppc64le.zip bitsrun_linux_mips64.zip bitsrun_android_arm64.zip

KristianLi commented 6 months ago

非常感谢大佬提供的支持,还没来得及把文件传进去结果误打误撞用电脑连着openwrt居然在浏览器打开了登陆页面认证了,最后发现完全不需要任何程序可以在电脑上直接完成,实属惊喜。 最后再次感谢大佬这两天的回复,祝您学业顺利!