skip to content

How do you replay a captured WebSocket message in Burp Repeater, and what limits apply compared with working in an HTTP tab?

level: middleimportance: nice to knowfreq 6%

answer

  1. start from the WebSockets history
  2. server direction or client direction
  3. connection is part of the test
  4. open only through the proxy
  5. no group sequence with WebSocket tabs

basics

~10 s

Right-click a message in Proxy's WebSockets history and choose Send to Repeater, edit it, pick server or client, and send. The client direction works only on connections still open through Burp Proxy.

solid answer

~40 s

Open the Proxy's WebSockets history, right-click a message and choose Send to Repeater. In the new tab edit the message, choose whether to send it to the server or the client, and press Send. To resend from the tab's history, use Edit and resend. The client direction exists only for connections still open via Burp Proxy. The tab shows the connection in use, and you can clone or attach to an open one, create a new one or reconnect a closed one, then adjust the negotiation request. A tab group sent in sequence cannot hold WebSocket tabs. Record the connection and direction used, because the server may log little of the message itself.

go deeper

for a junior

Recall the route: WebSockets history, Send to Repeater, edit, choose server or client, Send.

for a middle

Explain the connection controls, the open-via-proxy condition for sending to the client, and the sequence-send limit.

for a senior

Note the connection and direction in your evidence, and say what a reply does and does not show about authorisation per message.

for a principal

Decide how a team documents WebSocket testing when the server logs little, so findings stay reproducible by the owner.

## Starting from the WebSockets history A WebSocket tab in Burp Repeater is usually created from a captured message. The steps on PortSwigger's page are: 1. Open the WebSockets history in the Proxy and right-click a message. 2. Choose Send to Repeater. A new tab holds the message. 3. Modify the message in the editor. 4. Choose whether it goes to the server or to the client. 5. Press Send and read what comes back. 6. To send again, right-click a message in the tab's history and choose Edit and resend. Burp also lets you open a new tab and select WebSocket as its type. ## What a WebSocket tab holds | Part | What it is | |---|---| | Message editor | The message to be sent, with the usual editor functions | | Connection | The WebSocket connection the message travels over, set automatically when you send a message to Repeater | | History table | Every message sent and received; manually generated messages are marked | | Message viewer | The currently selected message | The connection is controllable. A toggle in the WebSocket ID header disconnects or reconnects. The edit icon in that header lets you clone or attach to any open connection, create a new connection, or reconnect a closed one, and you can then change the negotiation request used to create the WebSocket. A Select next message received option selects each incoming message in the history table as it arrives. ## The server and the client You can send a message to the server, or to the client. The option to send to the client is available only for connections that are **still open via Burp Proxy**. In other words, the client direction exists while the browser or app under test is connected through the proxy; once that connection has closed, only the server direction remains. ## Differences from an HTTP tab - **No fresh request per send.** A WebSocket message travels over an established connection, so the connection you choose is part of the experiment. - **Attaching has effects.** Attaching to a live connection places your message in a session in use. If it goes to the client, the test browser or app receives it. - **No sequence sends.** A group sent in sequence must contain no WebSocket message tabs, so WebSocket replay is a one-message-at-a-time activity. - **History looks different.** Messages in both directions share one table, with manual ones indicated. ## Reading the result as an assessor A reply is the application's inference about a message, nothing more. Compare it with the reply to the unmodified message, and remember that the server may have authenticated only the handshake. Whether it checks each message against the caller's permissions is the owner's design question, and the replay shows what happened on this connection and no further. ## Typical review uses Two uses fit an authorised review. One is replaying a reported message after a fix, to check that the server now rejects or closes it as intended. The other is checking that an unexpected or malformed message from a test account is handled without the server returning internal error text. In both, compare the reply with the reply to the unmodified message before concluding anything. ## What the owner sees On the server, a replayed message is one more frame on a connection, in the same session as the test account. The server may log little of a message's content, so the owner may see only connection activity, which makes the assessor's own notes the record of what was sent. Keep them, with the connection used and the direction chosen. ## Rules of engagement - Replay only on a WebSocket endpoint in the signed scope, with a test account. - Say in the notes whether you cloned, attached to or created the connection. - Do not send to the client unless that is part of the test plan; it injects a message into a browser or app session in use.

  • Why does the connection you choose matter when replaying a WebSocket message?
    A message travels over an established connection, and the session was usually authenticated at the handshake. Cloning, attaching to an open connection, creating one or reconnecting a closed one each give the server a different context. Note which you used, because the same message can behave differently across them.
  • When is the send-to-client direction available, and why be careful with it?
    Only for connections that are still open via Burp Proxy. It places a message into the live test browser or app session, so it has an effect on a client in use. Use it only when the test plan calls for it, and say so in the notes.

  • Believes a WebSocket message can always be sent to the client
  • Thinks a WebSocket tab can be added to a group sent in sequence
  • Treats a server's reply to a replayed message as proof of per-message authorisation
  • Ignores which connection a replay used and records only the message
  • Assumes the server's logs will hold the replayed message body