🕸️
Web Security Notes
  • README
  • Portswigger
    • Access Control
      • notes
      • labs
    • Authentication
      • notes
      • labs
    • Business Logic Vulnerabilities
      • notes
      • labs
    • Clickjacking
      • notes
      • labs
    • Command Injection
      • notes
      • labs
    • CORS
      • notes
      • labs
    • CSRF
      • notes
      • labs
    • Directory Traversal
      • notes
      • labs
    • DOM-based Vulnerabilities
      • notes
      • labs
    • File upload Vulnerabilities
      • notes
      • labs
    • HTTP Host Header Attacks
      • notes
      • labs
    • HTTP Request Smuggling
      • notes
      • labs
    • Information Disclosure
      • notes
      • labs
    • Insecure Deserialization
      • notes
      • labs
    • JWT Attacks
      • notes
      • labs
    • OAuth Authentication
      • notes
      • labs
    • Server Side Template Injection
      • notes
      • labs
    • SQL injection
      • notes
      • labs
      • cheat sheet
    • SSRF
      • notes
      • labs
    • Web Cache Poisoning
      • notes
      • labs
    • WebSockets
      • notes
      • labs
    • XSS
      • notes
      • labs
    • XXE Injection
      • notes
      • labs
Powered by GitBook
On this page
  • Lab - 1: Manipulating WebSocket messages to exploit vulnerabilities (A)
  • Lab - 2: Manipulating the WebSocket handshake to exploit vulnerabilities (P)
  1. Portswigger
  2. WebSockets

labs

Lab - 1: Manipulating WebSocket messages to exploit vulnerabilities (A)

  • This online shop has a live chat feature implemented using WebSockets. Chat messages that you submit are viewed by a support agent in real time. To solve the lab, use a WebSocket message to trigger an alert() popup in the support agent's browser.

  • use Burp Repeter, and send to server

{ "message": "<img src=x onerror='alert(1)'/>" }

Lab - 2: Manipulating the WebSocket handshake to exploit vulnerabilities (P)

  • This online shop has a live chat feature implemented using WebSockets.It has an aggressive but flawed XSS filter.To solve the lab, use a WebSocket message to trigger an alert() popup in the support agent's browser.

  • try with payload <img src=1 onerror=alert(1)> and chat was disconnect

  • try to reconnect but cannot connect

  • add X-Forwarded-For header with new IP address and can connect

  • solution payload

<img src=1 oNeRrOr=alert`1`>

PreviousnotesNextXSS

Last updated 2 years ago