PinkD / corplink-rs

使用 rust 实现的飞连客户端
GNU General Public License v2.0
194 stars 26 forks source link

在vpn连接时失败 #20

Closed Holmose closed 6 months ago

Holmose commented 6 months ago

thread 'main' panicked at 'error decoding response body: invalid type: null, expected a sequence at line 1 column 262', src/main.rs:114:21 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

1702545680139

PinkD commented 6 months ago

The 2fa code is generated successfully, so the problem must be here. You can try to print out what's returned by the server. According to your log, the server returned a none json string, so the json decoding operation failed.

https://github.com/PinkD/corplink-rs/blob/21fcbe41142a75f9c6605ad328339bbca1b0a1cc/src/client.rs#L593-L607

Holmose commented 6 months ago

排查后发现并不存在/vpn/conn这个接口返回的是404 page not found,应该是要抓包分析,请问安卓手机已经root,如何抓取飞连vpn连接过程,https协议

PinkD commented 6 months ago

android https capture 就能搜到一堆,我用的 HttpCanary ,大家的功能都大同小异,装一个证书,然后通过 vpn 功能实现 MITM 。要注意的是, MITM 会在连上 vpn 后马上失效,因为 vpn 被挤掉了,但是应该是能抓到最后一个请求的

Holmose commented 6 months ago

1702639782398 现在抓到包了,和这边的链接不一样,请问如何打印resp返回来的值,没编程过rust image 标号为9的显示的是ping、pong

PinkD commented 6 months ago

标号为9的显示的是ping、pong

9 是 ws 连接,无关


从你给的截图来看,你的飞连版本和我用的不一样,所以有的请求不同,我无法提供更多实际的帮助。如果你还想继续,我可以给你一些建议:

  1. 仔细研究这几个请求。查看和现有代码的异同,目前看来, vpn list 是一致的,后面的就不同了,你需要看请求是只有 url 变了还是连 body 都变了,如果是 body 都变了,那就需要修改代码逻辑了
  2. 如果需要修改代码逻辑,建议先入门 Rust 。它的思想很独特,学一下没有坏处
  3. 如果你修改得成功运行了,欢迎整理一下代码然后给本仓库提交 pr ,帮助到更多的人
Holmose commented 6 months ago

我的天(꒪Д꒪)ノ,我选择用docker 版本那个了,😂,这么麻烦阿,而且我也不知道你的版本 body 的返回结果是怎么样的