mirror of
https://github.com/luzhisheng/js_reverse.git
synced 2025-04-20 03:59:57 +08:00
调试websocket.md
This commit is contained in:
parent
d460180374
commit
074d673179
@ -6,6 +6,27 @@ fb测试地址
|
|||||||
|
|
||||||
打开f12,刷新页面,发现fb存在 `pending` 连接。
|
打开f12,刷新页面,发现fb存在 `pending` 连接。
|
||||||
|
|
||||||
|
先发送点内容测试一下 `”在最早在最早在最早在”`,单击 hex viewer 命令切换到utf-8显示格式
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
发送的内容有了。分别用以下变量进行全局搜索,发现 `version_id` 只存在一处
|
||||||
|
|
||||||
|
{
|
||||||
|
"request_id" : 135 ,
|
||||||
|
"type" : 3 ,
|
||||||
|
"payload" : "{\"version_id\":\"5374491402668733\",\"tasks\":[{\"label\":\"46\",\"payload\":\"{\\"thread_id\\":100010764288690,\\"otid\\":\\"6967764888584867991\\",\\"source\\":1966082,\\"send_type\\":1,\\"text\\":\\"在最早在最早在最早在\\n\\",\\"initiating_source\\":0,\\"skip_url_preview_gen\\":0}\",\"queue_name\":\"100010764288690\",\"task_id\":59,\"failure_count\":null},{\"label\":\"21\",\"payload\":\"{\\"thread_id\\":100010764288690,\\"last_read_watermark_ts\\":1661244604250,\\"sync_group\\":1}\",\"queue_name\":\"100010764288690\",\"task_id\":60,\"failure_count\":null}],\"epoch_id\":6967764888764024872,\"data_trace_id\":\"#/Fg8S8JQS66+1KJPWt0yig\"}" ,
|
||||||
|
"app_id" : "2220391788200892"
|
||||||
|
}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
断点调试看看
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
果然内容在 `tasks` 中
|
||||||
|
|
||||||
以下是 WebSocket 对象的相关事件。
|
以下是 WebSocket 对象的相关事件。
|
||||||
|
|
||||||
open Socket.onopen 连接建立时触发
|
open Socket.onopen 连接建立时触发
|
||||||
@ -15,5 +36,4 @@ fb测试地址
|
|||||||
Socket.send() 使用连接发送数据
|
Socket.send() 使用连接发送数据
|
||||||
Socket.close() 关闭连接
|
Socket.close() 关闭连接
|
||||||
|
|
||||||
先对 `Socket.send()` 打断点,但是发现存在很多位置,那如果快速找到 `Socket.send()` 发送的位置,`hook` `send()` 方法,直接快速
|
先对 `Socket.send()` 打断点,看能不能找到 `”在最早在最早在最早在”`的位置
|
||||||
|
|
@ -1,11 +1,21 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import websockets
|
from aiowebsocket.converses import AioWebSocket
|
||||||
|
|
||||||
|
|
||||||
async def echo(websocket, path):
|
async def startup(uri):
|
||||||
async for message in websocket:
|
async with AioWebSocket(uri) as aws:
|
||||||
message = "我收到了你的消息: {}".format(message)
|
converse = aws.manipulator
|
||||||
await websocket.send(message)
|
|
||||||
|
|
||||||
asyncio.get_event_loop().run_until_complete(websockets.serve(echo, 'localhost', 8765))
|
# 给服务端发送验证消息,观察网页接口数据动态获取
|
||||||
asyncio.get_event_loop().run_forever()
|
message = '{"request_id":54,"type":3,"payload":"{\"version_id\":\"5374491402668733\",\"tasks\":[{\"label\":\"46\",\"payload\":\"{\\\"thread_id\\\":100010764288690,\\\"otid\\\":\\\"6967776862074270634\\\",\\\"source\\\":1966082,\\\"send_type\\\":1,\\\"text\\\":\\\"在最早在最早在最早在\\\",\\\"initiating_source\\\":0,\\\"skip_url_preview_gen\\\":0}\",\"queue_name\":\"100010764288690\",\"task_id\":13,\"failure_count\":null},{\"label\":\"21\",\"payload\":\"{\\\"thread_id\\\":100010764288690,\\\"last_read_watermark_ts\\\":1661247458952,\\\"sync_group\\\":1}\",\"queue_name\":\"100010764288690\",\"task_id\":14,\"failure_count\":null}],\"epoch_id\":6967776862243990774,\"data_trace_id\":\"#SHgGQS0HTdSm+u12zRK3wA\"}","app_id":"2220391788200892"}'
|
||||||
|
await converse.send(message)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
receive = await converse.receive()
|
||||||
|
# 拿到的是byte类型数据,解码为字符串数据
|
||||||
|
print(receive.decode())
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
remote = 'wss://edge-chat.facebook.com/chat?region=prn&sid=5144947822952447&cid=17bf7923-1b48-488f-b1c9-311faaaa6715'
|
||||||
|
asyncio.get_event_loop().run_until_complete(startup(remote))
|
||||||
|
BIN
img/108.png
Normal file
BIN
img/108.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 63 KiB |
BIN
img/109.png
Normal file
BIN
img/109.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
BIN
img/110.png
Normal file
BIN
img/110.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
Loading…
x
Reference in New Issue
Block a user