Mmx233 / BitSrunLoginGo

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

连接报错Nas Type Not Found #34

Closed DissolveBoi closed 4 months ago

DissolveBoi commented 4 months ago
DissolveBoi commented 4 months ago

尝试使用172.16.1.2,报错如下:

2024-06-05 11:38:31 [INFO] 多网卡模式
2024-06-05 11:38:31 [DEBU] 网卡 lo 不匹配
2024-06-05 11:38:31 [DEBU] 网卡 docker0 不匹配
2024-06-05 11:38:31 [DEBU] 有效匹配网卡: [{wlan0 10.128.235.134:0}]
2024-06-05 11:38:31 [INFO] 使用网卡:  wlan0
2024-06-05 11:38:31 [DEBU] 开始嗅探 enc
2024-06-05 11:38:31 [DEBU] HTTP GET http://172.16.1.2/
2024-06-05 11:38:31 [DEBU] HTTP GET http://172.17.1.2/index_1.html?ip=10.128.235.134
2024-06-05 11:38:32 [DEBU] HTTP GET http://172.17.1.2/srun_portal_pc?ac_id=1&ip=10.128.235.134&theme=pro
2024-06-05 11:38:32 [DEBU] HTTP GET http://172.16.1.2/static/themes/pro/js/Portal.js
2024-06-05 11:38:32 [WARN] 找不到 enc,使用配置 enc
2024-06-05 11:38:32 [INFO] 正在获取登录状态
2024-06-05 11:38:32 [DEBU] HTTP GET http://172.16.1.2/cgi-bin/rad_user_info
2024-06-05 11:38:32 [DEBU] <!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="refresh" content="0;url=/srun_portal_pc?ac_id=1&amp;ip=10.128.235.134&amp;theme=pro">
</head>
<body>
</body>
</html>

2024-06-05 11:38:32 [ERRO] 网卡 wlan0 登录出错: invalid character '<' looking for beginning of value
Mmx233 commented 4 months ago

Nas Type Not Found 多半是 user type 填写有误,请使用程序生成的配置文件并核对 meta 和 user type。另外鉴于 url 中存在 amp 参数,建议前述检查无误后尝试启用 reality

Mmx233 commented 4 months ago

至于后者为什么无法工作,我无法就目前的信息修改代码。可以的话请附上 portal.js,完整登录过程 xhr 请求记录等。如有涉及表单的部分,所有看不懂的表单值请打码

DissolveBoi commented 4 months ago

抱歉,我对web相关实在不了解。但我在仔细查询并更改了Config之后,使用第一个172.16.8.8仍然出现了Nas Not Found错误。

DissolveBoi commented 4 months ago

再次尝试连接172.16.1.2,火狐的连接历史如下:

{
  "log": {
    "version": "1.2",
    "creator": {
      "name": "Firefox",
      "version": "126.0.1"
    },
    "browser": {
      "name": "Firefox",
      "version": "126.0.1"
    },
    "pages": [
      {
        "id": "page_1",
        "pageTimings": {
          "onContentLoad": -9296,
          "onLoad": -1718164259249
        },
        "startedDateTime": "2024-06-12T11:50:59.249+08:00",
        "title": "https://172.17.1.2/index_1.html?ip=10.128.235.134"
      }
    ],
    "entries": [
      {
        "startedDateTime": "2024-06-12T11:50:59.249+08:00",
        "request": {
          "bodySize": 0,
          "method": "GET",
          "url": "https://172.17.1.2/index_1.html?ip=10.128.235.134",
          "httpVersion": "",
          "headers": [
            {
              "name": "Host",
              "value": "172.17.1.2"
            },
            {
              "name": "User-Agent",
              "value": "Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0"
            },
            {
              "name": "Accept",
              "value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"
            },
            {
              "name": "Accept-Language",
              "value": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2"
            },
            {
              "name": "Accept-Encoding",
              "value": "gzip, deflate, br, zstd"
            },
            {
              "name": "Connection",
              "value": "keep-alive"
            },
            {
              "name": "Upgrade-Insecure-Requests",
              "value": "1"
            },
            {
              "name": "Sec-Fetch-Dest",
              "value": "document"
            },
            {
              "name": "Sec-Fetch-Mode",
              "value": "navigate"
            },
            {
              "name": "Sec-Fetch-Site",
              "value": "none"
            },
            {
              "name": "Sec-Fetch-User",
              "value": "?1"
            },
            {
              "name": "Priority",
              "value": "u=1"
            }
          ],
          "cookies": [],
          "queryString": [
            {
              "name": "ip",
              "value": "10.128.235.134"
            }
          ],
          "headersSize": 528
        },
        "response": {
          "status": 0,
          "statusText": "",
          "httpVersion": "",
          "headers": [],
          "cookies": [],
          "content": {
            "mimeType": "",
            "size": 0,
            "encoding": "base64",
            "text": ""
          },
          "redirectURL": "",
          "headersSize": 0,
          "bodySize": 0
        },
        "cache": {},
        "timings": {
          "blocked": 0,
          "dns": 0,
          "connect": 0,
          "ssl": 0,
          "send": 0,
          "wait": 0,
          "receive": 0
        },
        "time": 0,
        "_securityState": "insecure",
        "pageref": "page_1"
      }
    ]
  }
}
DissolveBoi commented 4 months ago

已经更换系统为Debian 12,该错误基本在我的机器上无法复现并提供更多信息。