调试websocket

This commit is contained in:
luzhisheng 2022-02-07 18:15:46 +08:00
parent e13acad175
commit 4a96831b17
7 changed files with 45 additions and 1 deletions

BIN
img/39.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
img/40.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
img/41.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
img/42.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
img/43.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

44
zy-websocket/案例站.md Normal file
View File

@ -0,0 +1,44 @@
## 调试虎牙
发现找到 pending 正在连接中 WebSocket
并发送一条测试信息
![debugger](../img/39.png)
进入js代码发现new WebSocket
![debugger](../img/40.png)
这里就要注意无论js代码怎么混淆 new WebSocket 肯定会出现
s && !o.online && e.useHttps && (h += ":4434");
var p = new WebSocket((e.useHttps ? "wss://" : "ws://") + h + _);
p.ip = h,
p.onopen = c,
p.onclose = d,
p.onerror = d
通过搜索发现很多 onmessage 和 send 方法
一个个打断点非常麻烦直接hook
p.send_ = p.send;
p.send = function(t){
debugger;
return p.send_(t);
}
![debugger](../img/41.png)
hook
![debugger](../img/42.png)
发送弹暮测试,定位到加密函数
![debugger](../img/43.png)
r中间存在我发送的代码内容打上断点
d.writeStruct("tReq", r)

View File

@ -26,7 +26,7 @@ websocket html5 不是v8引擎自带的本身就是关键词
心跳包客户端每隔30秒不固定发送给服务端信号服务端就回认为客户端还是在线
## 调试 message
## 调试 onmessage
![debugger](../img/34.png)