Coder Social home page Coder Social logo

mmx233 / bitsrunlogingo Goto Github PK

View Code? Open in Web Editor NEW
267.0 267.0 26.0 393 KB

深澜校园网登录程序 Go 语言版,适用于路由器、Windows、Linux 等。提供对 OpenWrt、Docker、Go Module 的支持

License: GNU Affero General Public License v3.0

Go 98.54% Dockerfile 1.26% Batchfile 0.19%
ddns docker golang multiplatform openwrt-package srun

bitsrunlogingo's Introduction

😋 This is Mmx233, welcome !

A cup of coffee a day, keep bugs away.

Go React TypeScript

Kubernetes MySQL Redis Nginx ElasticSearch

And going to learn.

Flutter Java Rust Python

These things taste good.

Jetbrains Openwrt 1Password Rancher

My stats.

Mmx's Github Stats

Mmx's Public Top Langs

bitsrunlogingo's People

Contributors

gh-mean avatar mmx233 avatar revincx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bitsrunlogingo's Issues

运行出错,状态异常: login_error

配置config.yaml

form:
    domain: 218.104.96.75
    username: "test"
    usertype: 
    password: "123456"
meta:
    "n": "200"
    type: "1"
    acid: "5"
    enc: srun_bx1
settings:
    basic:
        https: false
        skip_cert_verify: false
        timeout: 5
        interfaces: ""
    guardian:
        enable: false
        duration: 300
    daemon:
        enable: false
        path: .BitSrun
    log:
        debug_level: true
        write_file: false
        log_path: ./
        log_name: "log.txt"

运行出错返回状态

➜  下载 ./autoLogin
INFO[0000] Step.0: 正在检查状态                               
DEBU[0000] HTTP GET  http://218.104.96.75/cgi-bin/rad_user_info 
DEBU[0000] jQuery1664855092469151569({"client_ip":"100.88.19.216","ecode":0,"error":"not_online_error","error_msg":"","online_ip":"100.88.19.216","res":"not_online_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211105","st":1664855197}) 
INFO[0000] Step.1: 正在获取客户端ip                            
DEBU[0000] ip:  100.88.19.216                           
INFO[0000] Step.2: 正在获取token                            
DEBU[0000] HTTP GET  http://218.104.96.75/cgi-bin/get_challenge 
DEBU[0000] jQuery1664855092481557684({"challenge":"9c9c729b1988174795c25b56ca39e11212051dcb031ea9fd067242e9dc4b8fdc","client_ip":"100.88.19.216","ecode":0,"error":"ok","error_msg":"","expire":"58","online_ip":"100.88.19.216","res":"ok","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211105","st":1664855197}) 
DEBU[0000] token:  9c9c729b1988174795c25b56ca39e11212051dcb031ea9fd067242e9dc4b8fdc 
INFO[0000] Step.3: 执行登录…                                
DEBU[0000] HTTP GET  http://218.104.96.75/cgi-bin/srun_portal 
DEBU[0000] jQuery1664855092485084888({"client_ip":"100.88.19.216","ecode":"","error":"login_error","error_msg":"INFO Error,err_code=2","online_ip":"100.88.19.216","res":"login_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211105","st":1664855197}) 
INFO[0000] 登录结果: login_error                            
FATA[0000] 运行出错,状态异常:  login_error

如果使用浏览器校园网web认证返回jQuery

jQuery1124013612791141399927_1664855204808({"ServerFlag":4294967041,"add_time":1664855179,"all_bytes":0,"billing_name":"raddius代理测试","bytes_in":0,"bytes_out":0,"checkout_date":0,"domain":"shenlan-houyu","error":"ok","group_id":"3","keepalive_time":1664855309,"online_device_total":"2","online_ip":"100.88.19.216","online_ip6":"::","package_id":"0","products_id":"4","products_name":"一台电脑+一台手机产品","real_name":"","remain_bytes":0,"remain_seconds":0,"sum_bytes":9115858,"sum_seconds":177091,"sysver":"1.01.20211105","user_balance":0,"user_charge":0,"user_mac":"3c:9c:0f:7e:33:35","user_name":"02700647911","wallet_balance":0})

请问这是哪儿出问题了呢?

守护模式检测失败后不会尝试重新链接吗?为什么只是打印错误信息了

2024-05-25 21:25:28 [DEBU] Get "http://222.24.215.2/cgi-bin/rad_user_info?_=1716643527494&callback=jQuery352853646144125378649_1716643527494": dial tcp 222.24.215.2:80: connect: no route to host
2024-05-25 21:25:28 [ERRO] 登录出错: Get "http://222.24.215.2/cgi-bin/rad_user_info?_=1716643527494&callback=jQuery352853646144125378649_1716643527494": dial tcp 222.24.215.2:80: connect: no route to host
2024-05-25 21:25:48 [DEBU] 正在获取登录状态

请问后台挂起和进程守护是怎么实现的呢?

我在Config文件中开启了守护进程和后台挂起但是好像并没有起作用,请问是需要额外配置service然后用systemctl开启吗?
我是通过ssh远程连接服务器使用这个软件的,似乎我关闭当前ssh会话之后它就失效了?另外我在top中也没找到这个软件的进程,如果想查看后台的自动登录运行时候正常应该在top中寻找哪些进程呢?

关于docker容器的一下问题

1.redeme文件给的命令用下来会报错
root@BleachWrt:~# docker run path_to_config:/data/Config.yaml mmx233/bitsrunlogin-go:latest
docker: invalid reference format: repository name must be lowercase.
See 'docker run --help'.
如上错误
2.docker run mmx233/bitsrunlogin-go:latest, 我直接构建后 找到Config.yaml修改后不能使用
stderr: time="2022-09-17T18:13:34+08:00" level=info msg="[init] 已生成配置文件,请编辑 'Config.yaml' 然后重试"
stdout: time="2022-09-17T18:49:48+08:00" level=info msg="[Guardian mode]"
stdout: time="2022-09-17T18:51:09+08:00" level=info msg="[Guardian mode]"
stdout: time="2022-09-17T19:38:54+08:00" level=info msg="[Guardian mode]"

状态异常,无匹配

尝试放到X86的openwrt软路由中,反馈状态异常,无匹配。账号、密码、user_type都设置成功。

多线多号多拨问题

手头上有两个账号,路由器将一个lan口转为了wan口,插了两条线,今天尝试用openwrt和mwan3进行负载均衡,做到了带宽叠加的效果。
但是我在尝试用多网卡模式进行验证的时候发现,我们学校的深澜好像获取的是请求端的ip,和params中写的ip无关,于是就会有如下问题。
2023-05-30 07:33:04 [DEBU] 有效匹配网卡: [{eth1.3 10.111.16.9:0}]
2023-05-30 07:33:04 [INFO] 使用网卡: eth1.3
2023-05-30 07:33:04 [INFO] 正在获取登录状态
2023-05-30 07:33:04 [DEBU] HTTP GET http://202.201.252.10/cgi-bin/rad_user_info
2023-05-30 07:33:04 [DEBU] jQuery1685431984621869468({"ServerFlag":4294967040,"add_time":1685258888,"all_bytes":25648214940,"billing_name":"**联通-cucc","bytes_in":21936525994,"bytes_out":3711688946,"checkout_date":0,"domain":"cucc","error":"ok","group_id":"19","keepalive_time":1685431984,"online_device_total":"1","online_ip":"10.111.15.224","online_ip6":"2001:250:1800:1960::8f8","package_id":"0","products_id":"19","products_name":"**联通-cucc-50元/100M","real_name":"","remain_bytes":0,"remain_seconds":0,"sum_bytes":208603980192,"sum_seconds":2549617,"sysver":"1.01.20210607","user_balance":0,"user_charge":0,"user_mac":"","user_name":"","wallet_balance":0})
2023-05-30 07:33:04 [DEBU] 认证客户端 ip: 10.111.16.9
2023-05-30 07:33:04 [INFO] 已登录~
这个网卡绑定的是另一个**移动的账号,但是请求的结果依旧是wan1的**联通。
能否使用指定的网卡和验证网页进行通讯?

被Windows报毒了

用几个月了好好的,今天突然被Windows 11报毒隔离了。。。
image

Pull Request 预请求

感谢大佬的项目,我们学校也是用的深澜,于是我 fork 了一下仓库对源码进行了修改。现在想提出 PR 把我的修改合并上来,但是因为我刚接触 Golang 很多地方可能写得不是很好,而且目前我自己的魔改有点多,所以想先讨论一下需要保留那些东西?可以的话还请多指教。

我的 Fork: https://github.com/Revincx/bitsrunlogin-go/commits/main

不能follow重定向

不能follow 301:

./bitsrun_linux_amd64 --debug
INFO[0000] 正在获取登录状态                                     
DEBU[0000] HTTP GET  http://example.edu.cn/cgi-bin/rad_user_info 
DEBU[0000] <html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
 /html>
ERRO[0000] 登录出错:  invalid character '<' looking for beginning of value

https://github.com/Mmx233/BitSrunLoginGo/blob/672db9c15493c354e1280bb3ff0ed11e83e89712/pkg/srun/api.go#L31C9-L31C9

a.NoDirect = &(*client)

这句话相当于

a.NoDirect = client

导致之后修改了client的CheckRedirect。

建议修改为类似

a.NoDirect = &http.Client{
    Transport: client.Transport, Jar: client.Jar, Timeout: client.Timeout,
    CheckRedirect: func(_ *http.Request, _ []*http.Request) error {
        return http.ErrUseLastResponse
    },
}

连接报错Nas Type Not Found

  • JXNU,网页端在点击登陆按钮后无反应。与我校信息办沟通,得到如下信息:
    • 我校的登陆网页已从172.16.8.8更新至172.16.1.2,推荐使用后者;但浏览器无法加载后者的网页
    • 系统为EndeavourOS Linux x86_64
  • 遂尝试本项目
  • 报错如下:
2024-06-05 11:33:12 [INFO] 多网卡模式
2024-06-05 11:33:12 [DEBU] 网卡 lo 不匹配
2024-06-05 11:33:12 [DEBU] 网卡 docker0 不匹配
2024-06-05 11:33:12 [DEBU] 有效匹配网卡: [{wlan0 10.128.235.134:0}]
2024-06-05 11:33:12 [INFO] 使用网卡:  wlan0
2024-06-05 11:33:12 [DEBU] 开始嗅探 enc
2024-06-05 11:33:12 [DEBU] HTTP GET http://172.16.8.8/
2024-06-05 11:33:13 [DEBU] HTTP GET http://172.16.8.8/index_1.html
2024-06-05 11:33:13 [DEBU] HTTP GET http://172.16.8.8/srun_portal_pc?ac_id=1&amp;theme=pro
2024-06-05 11:33:13 [DEBU] HTTP GET http://172.16.8.8/static/themes/pro/js/Portal.js
2024-06-05 11:33:13 [DEBU] 使用嗅探 enc: srun_bx1
2024-06-05 11:33:13 [INFO] 正在获取登录状态
2024-06-05 11:33:13 [DEBU] HTTP GET http://172.16.8.8/cgi-bin/rad_user_info
2024-06-05 11:33:13 [DEBU] jQuery238298682278752356247_1717558393589({"client_ip":"10.128.235.134","ecode":0,"error":"not_online_error","error_msg":"","online_ip":"10.128.235.134","res":"not_online_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20230324","st":1717558393})
2024-06-05 11:33:13 [DEBU] 认证客户端 ip:  10.128.235.134
2024-06-05 11:33:13 [INFO] 检测到用户未登录,开始尝试登录...
2024-06-05 11:33:13 [DEBU] 正在获取 Token
2024-06-05 11:33:13 [DEBU] HTTP GET http://172.16.8.8/cgi-bin/get_challenge
2024-06-05 11:33:13 [DEBU] jQuery682965525481826118199_1717558393621({"challenge":"bc1e1a9a92cf7731be2b1c6c69d767ff083246c345d7dea08631562adb4598d1","client_ip":"10.128.235.134","ecode":0,"error":"ok","error_msg":"","expire":"60","online_ip":"10.128.235.134","res":"ok","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20230324","st":1717558393})
2024-06-05 11:33:13 [DEBU] token:  bc1e1a9a92cf7731be2b1c6c69d767ff083246c345d7dea08631562adb4598d1
2024-06-05 11:33:13 [DEBU] 发送登录请求
2024-06-05 11:33:13 [DEBU] HTTP GET http://172.16.8.8/cgi-bin/srun_portal
2024-06-05 11:33:13 [DEBU] jQuery763368616757859379688_1717558393734({"client_ip":"10.128.235.134","ecode":"","error":"login_error","error_msg":"Nas type not found.","online_ip":"10.128.235.134","res":"login_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20230324","st":1717558393})
2024-06-05 11:33:13 [ERRO] 网卡 wlan0 登录出错: login_error

作者有考虑加入ipv6支持吗

当前cernet等主流校园网线路商在ipv6资源上比v4更丰富,但是通过脚本自动登录的话会没有ipv6 ip下发,只有v4单栈

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

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

无法匹配的异常

image
首先感谢作者提供的这个工具,让我对校园网提起了希望。但是在我确认正确配置账号密码的的前提下,我发现还是出现如图的异常。
我也大致浏览了作者的源码,似乎应该是在第二步就已经出了问题,还没到验证账号密码那步,但是由于对Go语言的陌生。还是向作者求助,想了解出现这样的问题我应该作如何的解决方案,期待您的回复

双拨问题

读取配置文件失败: While parsing config: yaml: line 7: mapping values are not allowed in this context
这一行我是默认没动过的,但是提示

luci 应用崩溃


Error
Unhandled exception during request dispatching
Internal node resolve error

In resolve_page(), file /usr/share/ucode/luci/dispatcher.uc, line 668, byte 45:
  called from function [anonymous function] (/usr/share/ucode/luci/dispatcher.uc:902:41)
  called from anonymous function (/www/cgi-bin/luci:39:13)

 `        assert(node, "Internal node resolve error");`
  Near here ----------------------------------------^


OpenWrt SNAPSHOT r0-abedc90 / LuCI Master git-23.343.78641-c5b5640

多个网口使用同一个IP请求

root@OpenWrt:~# /usr/local/srunlogin/autoLogin --config=/usr/local/srunlogin/Config.yaml
time="2022-09-21T15:54:01+08:00" level=info msg="[Guardian mode]"
time="2022-09-21T15:54:01+08:00" level=debug msg="网卡 lo 不匹配"
time="2022-09-21T15:54:01+08:00" level=debug msg="网卡 sit0 不匹配"
time="2022-09-21T15:54:01+08:00" level=debug msg="网卡 dummy0 不匹配"
time="2022-09-21T15:54:01+08:00" level=debug msg="网卡 eth0 不匹配"
time="2022-09-21T15:54:01+08:00" level=debug msg="网卡 eth1 不匹配"
time="2022-09-21T15:54:01+08:00" level=debug msg="网卡 eth2 不匹配"
time="2022-09-21T15:54:01+08:00" level=debug msg="网卡 eth3 不匹配"
time="2022-09-21T15:54:01+08:00" level=debug msg="网卡 utun 不匹配"
time="2022-09-21T15:54:01+08:00" level=debug msg="网卡 br-lan 不匹配"
time="2022-09-21T15:54:01+08:00" level=debug msg="有效匹配网卡: **[{macvlan1 10.33.7.36:0} {macvlan2 10.33.7.37:0} {macvlan3 10.33.7.38:0}]"**
time="2022-09-21T15:54:01+08:00" level=info msg=macvlan1
time="2022-09-21T15:54:01+08:00" level=info msg="Step.0: 正在检查状态"
time="2022-09-21T15:54:01+08:00" level=debug msg="HTTP GET http://10.32.2.6/cgi-bin/rad_user_info"
time="2022-09-21T15:54:01+08:00" level=debug msg="jQuery1663746841049532976({"client_ip":"10.33.7.38","ecode":0,"error":"not_online_error","error_msg":"","online_ip":"10.33.7.38","res":"not_online_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211028","st":1663747068})"
time="2022-09-21T15:54:01+08:00" level=info msg="Step.1: 正在获取客户端ip"
time="2022-09-21T15:54:01+08:00" level=debug msg="ip: 10.33.7.38"
time="2022-09-21T15:54:01+08:00" level=info msg="Step.2: 正在获取token"
time="2022-09-21T15:54:01+08:00" level=debug msg="HTTP GET http://10.32.2.6/cgi-bin/get_challenge"
time="2022-09-21T15:54:01+08:00" level=debug msg="jQuery1663746841057449837({"challenge":"0908c40eb1f945356359121a3819a0340a37736c5c934b960916e5a4238e544d","client_ip":"10.33.7.38","ecode":0,"error":"ok","error_msg":"","expire":"60","online_ip":"10.33.7.38","res":"ok","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211028","st":1663747068})"
time="2022-09-21T15:54:01+08:00" level=debug msg="token: 0908c40eb1f945356359121a3819a0340a37736c5c934b960916e5a4238e544d"
time="2022-09-21T15:54:01+08:00" level=info msg="Step.3: 执行登录…"
time="2022-09-21T15:54:01+08:00" level=debug msg="HTTP GET http://10.32.2.6/cgi-bin/srun_portal"
time="2022-09-21T15:54:01+08:00" level=debug msg="jQuery1663746841062214576({"ServerFlag":0,"ServicesIntfServerIP":"0.0.0.0","ServicesIntfServerPort":"8001","access_token":"0908c40eb1f945356359121a3819a0340a37736c5c934b960916e5a4238e544d","checkout_date":0,"client_ip":"10.33.7.38","ecode":0,"error":"ok","error_msg":"","online_ip":"10.33.7.38","ploy_msg":"E0000: Login is successful.","real_name":"","remain_flux":0,"remain_times":0,"res":"ok","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211028","suc_msg":"login_ok","sysver":"1.01.20211028","username":"201936070036@unicom","wallet_balance":0})"
time="2022-09-21T15:54:01+08:00" level=info msg="登录结果: ok"
time="2022-09-21T15:54:01+08:00" level=info msg=macvlan2
time="2022-09-21T15:54:01+08:00" level=info msg="Step.0: 正在检查状态"
time="2022-09-21T15:54:01+08:00" level=debug msg="HTTP GET http://10.32.2.6/cgi-bin/rad_user_info"
time="2022-09-21T15:54:01+08:00" level=debug msg="jQuery1663746841088999396({"client_ip":"10.33.7.38","ecode":0,"error":"not_online_error","error_msg":"","online_ip":"10.33.7.38","res":"not_online_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211028","st":1663747068})"
time="2022-09-21T15:54:01+08:00" level=info msg="Step.1: 正在获取客户端ip"
time="2022-09-21T15:54:01+08:00" level=debug msg="ip: 10.33.7.38"
time="2022-09-21T15:54:01+08:00" level=info msg="Step.2: 正在获取token"
time="2022-09-21T15:54:01+08:00" level=debug msg="HTTP GET http://10.32.2.6/cgi-bin/get_challenge"
time="2022-09-21T15:54:01+08:00" level=debug msg="jQuery1663746841095553629({"challenge":"0908c40eb1f945356359121a3819a0340a37736c5c934b960916e5a4238e544d","client_ip":"10.33.7.38","ecode":0,"error":"ok","error_msg":"","expire":"60","online_ip":"10.33.7.38","res":"ok","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211028","st":1663747068})"
time="2022-09-21T15:54:01+08:00" level=debug msg="token: 0908c40eb1f945356359121a3819a0340a37736c5c934b960916e5a4238e544d"
time="2022-09-21T15:54:01+08:00" level=info msg="Step.3: 执行登录…"
time="2022-09-21T15:54:01+08:00" level=debug msg="HTTP GET http://10.32.2.6/cgi-bin/srun_portal"
time="2022-09-21T15:54:01+08:00" level=debug msg="jQuery1663746841099915247({"client_ip":"10.33.7.38","ecode":"","error":"login_error","error_msg":"no_response_data_error","online_ip":"10.33.7.38","res":"login_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211028","st":1663747068})"
time="2022-09-21T15:54:01+08:00" level=info msg="登录结果: login_error"
time="2022-09-21T15:54:01+08:00" level=error msg="网口 macvlan2 登录失败: login_error"
time="2022-09-21T15:54:01+08:00" level=info msg=macvlan3
time="2022-09-21T15:54:01+08:00" level=info msg="Step.0: 正在检查状态"
time="2022-09-21T15:54:01+08:00" level=debug msg="HTTP GET http://10.32.2.6/cgi-bin/rad_user_info"
time="2022-09-21T15:54:01+08:00" level=debug msg="jQuery1663746841116711376({"client_ip":"10.33.7.38","ecode":0,"error":"not_online_error","error_msg":"","online_ip":"10.33.7.38","res":"not_online_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211028","st":1663747068})"
time="2022-09-21T15:54:01+08:00" level=info msg="Step.1: 正在获取客户端ip"
time="2022-09-21T15:54:01+08:00" level=debug msg="ip: 10.33.7.38"
time="2022-09-21T15:54:01+08:00" level=info msg="Step.2: 正在获取token"
time="2022-09-21T15:54:01+08:00" level=debug msg="HTTP GET http://10.32.2.6/cgi-bin/get_challenge"
time="2022-09-21T15:54:01+08:00" level=debug msg="jQuery1663746841123326422({"challenge":"0908c40eb1f945356359121a3819a0340a37736c5c934b960916e5a4238e544d","client_ip":"10.33.7.38","ecode":0,"error":"ok","error_msg":"","expire":"60","online_ip":"10.33.7.38","res":"ok","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211028","st":1663747068})"
time="2022-09-21T15:54:01+08:00" level=debug msg="token: 0908c40eb1f945356359121a3819a0340a37736c5c934b960916e5a4238e544d"
time="2022-09-21T15:54:01+08:00" level=info msg="Step.3: 执行登录…"
time="2022-09-21T15:54:01+08:00" level=debug msg="HTTP GET http://10.32.2.6/cgi-bin/srun_portal"
time="2022-09-21T15:54:01+08:00" level=debug msg="jQuery1663746841127485178({"client_ip":"10.33.7.38","ecode":"","error":"login_error","error_msg":"no_response_data_error","online_ip":"10.33.7.38","res":"login_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211028","st":1663747068})"
time="2022-09-21T15:54:01+08:00" level=info msg="登录结果: login_error"
time="2022-09-21T15:54:01+08:00" level=error msg="网口 macvlan3 登录失败: login_error"

登录失败,请问 enc 参数应该填哪个

日志和配置文件如下,其他参数都按照请求对应填写了,只有 enc 参数不清楚该填哪个

log

2023-11-29 22:20:59 [INFO] 正在获取登录状态
2023-11-29 22:20:59 [DEBU] HTTP GET  http://172.16.245.50/cgi-bin/rad_user_info
2023-11-29 22:20:59 [DEBU] jQuery1701267659291280900({"client_ip":"10.24.20.229","ecode":0,"error":"not_online_error","error_msg":"","online_ip":"10.24.20.229","res":"not_online_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211028","st":1701267694})
2023-11-29 22:20:59 [DEBU] 认证客户端 ip:  10.24.20.229
2023-11-29 22:20:59 [INFO] 检测到用户未登录,开始尝试登录...
2023-11-29 22:20:59 [DEBU] 正在获取 Token
2023-11-29 22:20:59 [DEBU] HTTP GET  http://172.16.245.50/cgi-bin/get_challenge
2023-11-29 22:20:59 [DEBU] jQuery1701267659296699900({"challenge":"404b351fba3619454ccf7d70728ce46c06bee268662fcb8137da77861df9be59","client_ip":"10.24.20.229","ecode":0,"error":"ok","error_msg":"","expire":"60","online_ip":"10.24.20.229","res":"ok","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211028","st":1701267694})
2023-11-29 22:20:59 [DEBU] token:  404b351fba3619454ccf7d70728ce46c06bee268662fcb8137da77861df9be59
2023-11-29 22:20:59 [DEBU] 发送登录请求
2023-11-29 22:20:59 [DEBU] HTTP GET  http://172.16.245.50/cgi-bin/srun_portal
2023-11-29 22:20:59 [DEBU] jQuery1701267659300148000({"client_ip":"10.24.20.229","ecode":"E2806","error":"login_error","error_msg":"E2806: Products is not found (39).","online_ip":"10.24.20.229","res":"login_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211028","st":1701267694})
2023-11-29 22:20:59 [ERRO] 登录出错:  login_error

image
Snipaste_2023-11-29_22-28-10

登录遇到一些问题

2022/05/02 13:47:58 [INFO] Step.0: ..................
2022/05/02 13:47:58 [DEBUG] HTTP GET http://202.114.177.246/cgi-bin/rad_user_info
2022/05/02 13:47:58 [DEBUG] jQuery1651499278712989803({"client_ip":"10.8.47.238","ecode":0,"error":"not_online_error","error_msg":"","online_ip":"10.8.47.238","res":"not_online_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20201030","st":1651499360})
2022/05/02 13:47:58 [INFO] Step.1: .....................ip
2022/05/02 13:47:58 [DEBUG] ip: 10.8.47.238
2022/05/02 13:47:58 [INFO] Step.2: ............token
2022/05/02 13:47:58 [DEBUG] HTTP GET http://202.114.177.246/cgi-bin/get_challenge
2022/05/02 13:47:58 [DEBUG] jQuery1651499278730144442({"challenge":"e442a8fe5f36eba4616b3edcb05ecefd4d5545592a224121221805bbfc1579a3","client_ip":"10.8.47.238","ecode":0,"error":"ok","error_msg":"","expire":"60","online_ip":"10.8.47.238","res":"ok","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20201030","st":1651499360})
2022/05/02 13:47:58 [DEBUG] token: e442a8fe5f36eba4616b3edcb05ecefd4d5545592a224121221805bbfc1579a3
2022/05/02 13:47:58 [INFO] Step.3: ...............
2022/05/02 13:47:58 [DEBUG] HTTP GET http://202.114.177.246/cgi-bin/srun_portal
2022/05/02 13:48:01 [DEBUG] jQuery1651499278739853264({"client_ip":"10.8.47.238","ecode":"","error":"login_error","error_msg":"INFO failed, BAS respond timeout.","online_ip":"10.8.47.238","res":"login_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20201030","st":1651499363})
2022/05/02 13:48:01 [INFO] ............: login_error
2022/05/02 13:48:01 [FATAL] ...........................: login_error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.