1---2name: pentest-client-advanced3description: Advanced client-side attacks — CORS misconfiguration, WebSocket security, clickjacking, postMessage abuse, CSS injection, and browser storage vulnerabilities.4---56# Pentest Client Advanced78## Purpose9Test advanced client-side attack surfaces beyond XSS. Six WSTG-CLNT items remain unchecked in Shannon's pipeline — these are distinct attack classes requiring different methodology than taint analysis.1011## Prerequisites1213### Authorization Requirements14- **Written authorization** with client-side testing scope15- **Test domains** for hosting PoC HTML pages (attacker-controlled origin)16- **Browser testing environment** with DevTools access17- **Target user simulation** — ability to test cross-origin interactions1819### Environment Setup20- Modern browser with DevTools (Chrome/Firefox)21- Burp Suite for intercepting WebSocket and cross-origin traffic22- Local HTTP server for hosting PoC pages (python -m http.server)23- Playwright for automated browser-based attack verification2425## Core Workflow261. **CORS Misconfiguration**: Test reflected Origin in ACAO header, null origin bypass, subdomain wildcard abuse, credential leakage via cross-origin requests (WSTG-CLNT-07).272. **WebSocket Security**: Missing auth on WS upgrade, CSWSH (Cross-Site WebSocket Hijacking), injection through WS messages, missing origin validation (WSTG-CLNT-10).283. **Clickjacking**: Missing X-Frame-Options / CSP frame-ancestors, UI redressing, drag-and-drop hijacking, multi-step clickjacking chains (WSTG-CLNT-09).294. **postMessage Abuse**: Missing origin validation in message handlers, DOM manipulation via cross-origin messages, prototype pollution through postMessage (WSTG-CLNT-11).305. **CSS Injection**: Data exfiltration via CSS attribute selectors + background-image, CSS-based keylogging, style injection for UI manipulation (WSTG-CLNT-05).316. **Client-Side Storage**: Sensitive data in localStorage/sessionStorage, IndexedDB exposure, service worker cache poisoning (WSTG-CLNT-06).327. **PoC Construction**: Build HTML pages demonstrating each attack with real impact.3334## WSTG Coverage3536| WSTG ID | Test Name | Status |37|---------|-----------|--------|38| WSTG-CLNT-05 | CSS Injection | ✅ |39| WSTG-CLNT-06 | Client-Side Resource Manipulation | ✅ |40| WSTG-CLNT-07 | Cross-Origin Resource Sharing | ✅ |41| WSTG-CLNT-09 | Clickjacking | ✅ |42| WSTG-CLNT-10 | WebSocket Testing | ✅ |43| WSTG-CLNT-11 | Web Messaging | ✅ |4445## Tool Categories4647| Category | Tools | Purpose |48|----------|-------|---------|49| CORS Testing | CORScanner, curl, custom PoC pages | CORS misconfiguration detection |50| WebSocket | websocket-client (Python), Burp WS | WebSocket hijacking and injection |51| Clickjacking | custom HTML iframes, Playwright | UI redressing PoC construction |52| Browser Automation | Playwright, Puppeteer | Automated client-side attack verification |53| Storage Analysis | Browser DevTools, custom JS | localStorage/IndexedDB inspection |5455## References56- `references/tools.md` - Tool function signatures and parameters57- `references/workflows.md` - Attack pattern definitions and test vectors