hunt-websocket
하는 일
이 스킬은 WebSocket과 socket.io 기능에서 하이재킹, 메시지마다의 약한 검사, 접근 제어 공백을 점검합니다. 채팅, 실시간 대시보드, 거래 기능을 허가받아 테스트할 때 사용합니다.
사용하는 경우
- ✓앱이 채팅, 실시간 데이터, 거래에 WebSocket을 쓸 때.
- ✓연결이 브라우저 쿠키에 의존하고 출처 확인을 점검하고 싶을 때.
- ✓권한이 필요한 메시지가 새로운 권한 검사 없이 받아들여질 수 있는 경우.
스킬 링크
https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-websocket/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“저희 채팅 앱은 쿠키와 함께 WebSocket을 씁니다. 허가된 테스트에서 다른 웹사이트가 로그인한 사용자로 소켓을 열 수 있는지 확인해 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 핸드셰이크와 출처 검사를 살펴본 뒤, 변조되거나 권한이 필요한 메시지를 보내 받아들여지는지 확인합니다. 증명과 함께 확인된 문제를 보고합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
HUNT-WEBSOCKET — WebSocket Security
Crown Jewel Targets
CSWSH (Cross-Site WebSocket Hijacking) with a cookie-authenticated handshake and no CSRF/per-connection token = High–Critical (real-time exfil of any logged-in victim's data).
Highest-value chains:
- CSWSH → data exfil / ATO — handshake authenticates via ambient cookie, no CSRF token, Origin not enforced → attacker page opens WS as the victim and streams their messages/PII/tokens. If the stream carries a session/refresh/CSRF token, this escalates to ATO.
- No per-message auth — HTTP/handshake auth present but individual WS frames are not re-authorized → privileged messages accepted (
deleteUser,getSecretConfig). - Message tampering — modify in-flight frames (price, qty, userId, amount) in trading/game/checkout apps → financial fraud.
- socket.io namespace / room authz bypass — connect to a privileged namespace or join another user's room without a permission check → cross-tenant real-time exfil.
- Handshake-layer Upgrade smuggling — a malformed
Upgrade/Connection/Sec-WebSocket-*handshake makes the front proxy and origin disagree on whether an upgrade occurred → request-smuggling tunnel.
Grounding — Reference Cases (read before hunting)
These are public, verifiable references. Use them to calibrate what a real WS finding looks like and how it was proven. Do not invent additional report IDs or payouts.
| # | Source / ID | Class | Lesson |
|---|---|---|---|
| 1 | PortSwigger Web Security Academy — "Cross-site WebSocket hijacking" (research + labs) | CSWSH | Canonical CSWSH model: cookie-auth handshake + no CSRF token + missing Origin check → attacker reads/sends as victim. The authoritative methodology. |
| 2 | Christian Schneider — "Cross-Site WebSocket Hijacking (CSWSH)" (original disclosure/write-up, 2013) | CSWSH | First public CSWSH technique: cookie-auth handshake + no Origin enforcement; PoC must prove victim-data receipt in the attacker browser, not just a 101. |
| 3 | Coda CSWSH (referenced in this repo's hunt-csrf set) | CSWSH | Real-time collab apps commonly authenticate the socket purely via cookie; Origin allow-listing was the missing control. |
| 4 | CVE-2020-7662 — websocket-extensions (Node) ReDoS |
DoS | A crafted Sec-WebSocket-Extensions header triggers catastrophic backtracking — handshake header is an attack surface, not just frames. |
| 5 | CVE-2024-37890 — ws (Node) DoS |
DoS | Many handshake request headers exhaust the server; confirms the handshake itself is parser-attackable pre-frames. |
| 6 | Outdated socket.io / Engine.IO stacks |
socket.io | Motivates the version-fingerprint step in Phase 7 — fingerprint the version, then check that release's known advisories. |
Only the four CVEs above are asserted with exact IDs because they are verifiable. For any case where you are not certain of the exact identifier, describe the technique with no citation — a wrong CVE is worse than none.
Phase 1 — Discover WebSocket Endpoints
# Grep JS for WS connections (handshake URLs, socket.io clients)
grep -rE "new WebSocket|io\(|io\.connect|socket\.io|new SockJS|signalr|Phoenix\.Socket|wss?://" \
recon/$TARGET/ --include="*.js" 2>/dev/null | \
grep -oE "(wss?://[^'\"]+|/[a-zA-Z0-9/_.-]*socket[^'\"]*|/signalr[^'\"]*|/cable\b)" | sort -u
# Crawl URLs for realtime hints
grep -iE "socket|/ws\b|websocket|stream|realtime|live|chat|events|/cable|/signalr|notifications" \
recon/$TARGET/urls.txt | sort -u
# Probe handshake (101 = upgrade supported)
curl -sI -o /dev/null -w "%{http_code}\n" \
-H "Connection: Upgrade" -H "Upgrade: websocket" \
-H "Sec-WebSocket-Version: 13" \
-H "Sec-WebSocket-Key: $(head -c16 /dev/urandom | base64)" \
"https://$TARGET/ws"
# socket.io polling handshake leaks version + sid
curl -s "https://$TARGET/socket.io/?EIO=4&transport=polling" | head -c 300; echo
# Non-standard WS ports
nmap -sV -p 80,443,3000,3001,8080,8443,8888,9000 $TARGET 2>/dev/null | grep open
In Burp Pro, use get_proxy_websocket_history (and the WebSockets tab) after browsing the app to enumerate live sockets, message schemas, and which frames carry auth-sensitive data.
Phase 2 — CSWSH (Cross-Site WebSocket Hijacking)
CSWSH requires THREE conditions together: (a) the handshake authenticates via an ambient credential (cookie sent automatically), (b) there is no unpredictable per-connection token in the handshake (no CSRF toke
자주 묻는 질문
사이트 간 WebSocket 하이재킹이란 무엇인가요?
다른 웹사이트가 피해자의 쿠키를 사용하는 소켓을 열어, 전송되는 데이터를 읽는 것입니다.
개별 메시지도 확인하나요?
네. 스킬은 처음 연결만이 아니라 각 메시지가 권한을 가졌는지도 테스트합니다.
어떤 프레임워크를 다루나요?
socket.io, SignalR, Phoenix Channels를 언급합니다.
상세 정보
작성자의 원본 설명
Hunt WebSocket vulnerabilities — Cross-Site WebSocket Hijacking (CSWSH), missing/weak Origin validation on the WS handshake, no per-message authentication, message tampering, socket.io namespace/room authorization bypass, and handshake-layer Upgrade smuggling. Use when target has WebSocket endpoints (ws:// or wss://), socket.io / SignalR / Phoenix Channels, real-time features, chat, live dashboards, notifications, or trading platforms.
인기도
- GitHub 스타
- 5.4k
- 순위
- #14939
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
apk-redteam-pipeline
5.4k에이전트가 APK 파일을 찾고 디컴파일하는 것부터 노출된 비밀 값을 확인하는 것까지, Android 앱의 보안 약점을 테스트하도록 돕습니다.
bugcrowd-reporting
5.4k에이전트가 올바른 범주를 고르고 범위 밖 이의에 답하며, Bugcrowd 취약점 보고서를 더 잘 쓰도록 돕습니다.
cloud-iam-deep
5.4k에이전트가 승인된 보안 테스트 중 찾은 클라우드 자격 증명이 AWS, Azure, Google Cloud에서 무엇에 접근할 수 있는지 확인하도록 돕습니다.
enterprise-vpn-attack
5.4k에이전트가 승인된 테스트 중 Cisco, Fortinet, Citrix 등의 VPN과 원격 접속 장비에서 알려진 약점을 확인하도록 돕습니다.