Skip to content

Chapter 4

Getting frames through

Four tools cover a manual test. None of them should be aimed at a flood.

2 min readWebSocket

Reach for the smallest tool that lets you send one clean frame and read the reply. Open Burp when you need full history, and save parallel bursts strictly for authorized race tests on your own accounts.

wscat is the fastest interactive terminal client when you just want to poke at a socket by hand. Install it and pass your own session cookie.

Terminal window
npm install -g wscat
wscat -c "wss://target.com/ws" -H "Cookie: session=YOUR_SESSION"

Type one JSON frame and read the reply. Add -H "Origin: https://evil.example" when you are testing Origin. Replace that host with one you control.

websocat is the non-interactive client. It can send a raw frame, repeat a file, and open more than one connection. Read websocat --help before you depend on a flag. This form sets a header without a guess about short flags.

Terminal window
websocat wss://target.com/ws --header "Cookie: session=YOUR_SESSION"

Use it when you want a frame in a file, sent again, with the reply saved. Do not point a repeat loop at a target.

  1. Confirm the proxy path includes the socket host.
  2. Find the GET that returned status 101.
  3. Choose Create WebSocket session.
  4. Edit one frame and send it.
  5. Keep the original handshake in the report export.

Repeater rules apply. You can change a field, send, and compare the next frame. Intruder-style volume does not belong on a socket that has no per-frame limit. You already know the limit is missing after a few dozen frames.

Turbo Intruder can send many frames on a captured socket. That makes Turbo Intruder the tool for a race. A high frame count can take the host down.

  1. Start from the extension’s own WebSocket example.
  2. Point it at a handshake from an account you own.
  3. Set the count to two before the first run.
  4. Raise the count only inside the program rules.

A coupon, a balance transfer, or a one-time subscribe is the usual race. Stop when two replies prove the state changed twice. You do not need a screenshot of a dead service. The race condition chapter in Bug Hunting for Beginners has the single-packet procedure.

Some servers close a replay if that token already has a socket open. The second handshake dies, and it looks like a failed bug. Close the first socket, then replay. Or open the second socket with a different account. Record it if both sockets stay authenticated. That is its own checklist item. The server promised a single session and did not enforce it.

A browser page you host is enough for the CSWSH proof. You do not need a collector that forwards frames to another server. console.log on a page you own is the proof. A proxy history export is the attachment.

Next, Chapter 5 shows how to write the report.

Connections1 backlink · 1 outgoing · 2 cross-guideFull graph →
Open local graph around this page
Open full graph →
Click a node to open · Drag to reposition · Scroll to zoom

WebSocketFor authorized testing only.