summary refs log tree commit diff
path: root/ReferenceClientProxyImplementation/Resources/Private/Injections/WebSocketDumper.html
diff options
context:
space:
mode:
Diffstat (limited to 'ReferenceClientProxyImplementation/Resources/Private/Injections/WebSocketDumper.html')
-rw-r--r--ReferenceClientProxyImplementation/Resources/Private/Injections/WebSocketDumper.html22
1 files changed, 22 insertions, 0 deletions
diff --git a/ReferenceClientProxyImplementation/Resources/Private/Injections/WebSocketDumper.html b/ReferenceClientProxyImplementation/Resources/Private/Injections/WebSocketDumper.html
new file mode 100644

index 0000000..14dc989 --- /dev/null +++ b/ReferenceClientProxyImplementation/Resources/Private/Injections/WebSocketDumper.html
@@ -0,0 +1,22 @@ +<script> + window.sockets = []; + var lastBuff = ''; + const nativeWebSocket = window.WebSocket; + window.WebSocket = function (...args) { + console.log("Starting new websocket"); + const socket = new nativeWebSocket(...args); + window.sockets.push(socket); + if (!args[0].includes('spotify')) + socket.addEventListener("message", ev => { + console.log("Dumping message..."); + lastBuff = ev.data; + var dat = new Uint8Array(lastBuff); + if (window.toHexString) console.log(window.toHexString(dat)); + var xhr = new XMLHttpRequest; + xhr.open("POST", "http://localhost:2001/dump/cs", false); + xhr.send(ev.data); + }); + console.log("Websocket hooked!", socket); + return socket; + }; +</script> \ No newline at end of file