js_reverse/zy-websocket/案例站.md
2022-02-08 18:09:28 +08:00

65 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 调试虎牙
发现找到 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)
发送弹暮测试,定位到加密函数
w && m.connected && w.send(t)
这里的 && 如果 w为true m.connected为truew.send(t)为true。执行w.send(t)
![debugger](../img/44.png)
这里可以看到t是发送的二进制的数据
![debugger](../img/43.png)
r 值序列化数据
a = JSON.stringify(r)
b = JSON.parse(a)
![debugger](../img/46.png)
r中间存在我发送的代码内容打上断点
d.writeStruct("tReq", r)
这里能发现 d 存在方法做加密d是由 var d = new l.Wup; 得到的,那么现在需要搞定 l 值。
![debugger](../img/45.png)
l 值是 h.Taf 得到的, h 值是 t.taf 得到的那买t值t值是传入的