mirror of
https://github.com/luzhisheng/js_reverse.git
synced 2025-04-12 03:27:07 +08:00
socket服务器
This commit is contained in:
parent
13fe675fb6
commit
fc48c8a2a6
BIN
img/61.png
Normal file
BIN
img/61.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 58 KiB |
BIN
img/62.png
Normal file
BIN
img/62.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
@ -6,7 +6,7 @@
|
||||
};
|
||||
|
||||
ws.onmessage = function (evt) {
|
||||
console.log(window.ayf.RSA.evcrypt(evt.data))
|
||||
console.log(window.ayf.RSA.evcrypt(evt.data));
|
||||
};
|
||||
|
||||
ws.onclose = function (evt) {
|
||||
|
9236
zy-rpc/ppui-static-pc.cdn.bcebos.com/passApi/js/loginv5_8bfd9d2.js
Normal file
9236
zy-rpc/ppui-static-pc.cdn.bcebos.com/passApi/js/loginv5_8bfd9d2.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -46,3 +46,62 @@ websockets 地址
|
||||
|
||||
ws://127.0.0.1:8765
|
||||
|
||||
## 案例百度登陆
|
||||
|
||||
找到RSA加密地方
|
||||
|
||||
e.RSA.encrypt('111111111111111')
|
||||
|
||||

|
||||
|
||||
将js保存到本地替换
|
||||
|
||||

|
||||
|
||||
进行js注入
|
||||
|
||||
if (e.RSA && e.rsakey) {
|
||||
var s = o;
|
||||
|
||||
!function () {
|
||||
window.ayf = e;
|
||||
var ws = new WebSocket("ws://127.0.0.1:9999");
|
||||
|
||||
ws.onopen = function (evt) {
|
||||
};
|
||||
|
||||
ws.onmessage = function (evt) {
|
||||
ws.send(window.ayf.RSA.evcrypt(evt.data))
|
||||
};
|
||||
|
||||
ws.onclose = function (evt) {
|
||||
};
|
||||
|
||||
}();
|
||||
|
||||
s.length < 128 && !e.config.safeFlag && (i.password = baidu.url.escapeSymbol(e.RSA.encrypt(s)),
|
||||
i.rsakey = e.rsakey,
|
||||
i.crypttype = 12)
|
||||
}
|
||||
|
||||
python 服务端代码
|
||||
|
||||
import asyncio
|
||||
import websockets
|
||||
import time
|
||||
|
||||
|
||||
async def echo(websocket, path):
|
||||
while True:
|
||||
t = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
|
||||
await websocket.send(t)
|
||||
msg = await websocket.recv()
|
||||
print(msg)
|
||||
await asyncio.sleep(10)
|
||||
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(
|
||||
websockets.serve(echo, '127.0.0.1', 9999))
|
||||
asyncio.get_event_loop().run_forever()
|
||||
|
||||
|
||||
|
@ -1,12 +1,17 @@
|
||||
import asyncio
|
||||
import websockets
|
||||
import time
|
||||
|
||||
|
||||
async def echo(websocket, path):
|
||||
async for message in websocket:
|
||||
message = "I got your message: {}".format(message)
|
||||
await websocket.send(message)
|
||||
while True:
|
||||
t = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
|
||||
await websocket.send(t)
|
||||
msg = await websocket.recv()
|
||||
print(msg)
|
||||
await asyncio.sleep(10)
|
||||
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(websockets.serve(echo, 'localhost', 8765))
|
||||
asyncio.get_event_loop().run_until_complete(
|
||||
websockets.serve(echo, '127.0.0.1', 9999))
|
||||
asyncio.get_event_loop().run_forever()
|
||||
|
Loading…
x
Reference in New Issue
Block a user