Vulnerabilities in WebSocket Configurations and Their Operation PART 4

Depov

Activist
ULTIMATE
SUPREME
PREMIUM
MEMBER
Joined
Feb 18, 2025
Messages
128
Reaction score
116
Deposit
0$
Spider Tools - What to Use in Intelligence and Attack


Let's get it alltogether. What does the WS testing process look like fromscratch?

1. Intelligence (Recon)

  1. Search for endpoints: Parsim JS-files application (app.js, main.chunk.js) for the new WebSocket(ws://, wss://, /socket.io, /ws. Tools: grep, Burp Suite, custom scripts.
  2. Traffic analysis: Open the application in the browser with DevTools. See the tab Network -> WS. We study:
    • The price list URL.
    • Headings of handshake (especially Origin, Sec-WebSocket-Protocol)
    • Message format (JSON, binary, text).
    • Sequence of messages (authentication, subscription, etc.).
  3. Server Information Collection: Server Responses may contain headers that disclose technology (Server: Node.js,
    X-Powered-By: Socket.io) Sometimes in errors (with an incorrect handshake), you can see intersections.

2. Fazing andVulnerability Testing

  1. Handshake: We use our ws-harnessfor verification of Origin, Subprotocolos, custom headlines.
  2. Protocol: Use the extended phaser for injection, message change. Intercept traffic through mitmproxy and modify it.
  3. Authorization: Let's try to connect without a token, with someone else's token (if we can get it or predict it).
  4. Isolation: We try to subscribe to other people's channels, send a message on someone else's behalf.
  5. Load test (cautiously!): Check how the server responds to thousands of connections, to huge frames, to frequent ping/pong. Tools: autobahn-testsuite(Useful and Negative Testing) websocket-bench.

3. Exploitation

  1. For Origin Hijacking: We write an exploit, place on our server, lure the victim.
  2. For injection: We use compromised access for data theft, escalation of privileges (substitution "user_id" in messages).
  3. For Deseresilization: We are preparing a shell code for a specific technology and send it to a binary message.
 
Top Bottom