Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

xss-testing

БесплатноЗапускает вложенные скриптыНе проверен

Validate Cross-Site Scripting (XSS) vulnerabilities including Reflected, Stored, and DOM-based XSS. Test by injecting script payloads into user-controlled…

anshumanbhот anshumanbh★ 287 звёзд на GitHub

Об этом скилле

Cross-Site Scripting (XSS) Testing Skill

Purpose

Validate XSS vulnerabilities by injecting script payloads into user-controlled inputs and observing:

  • Payload reflection without encoding in HTTP responses
  • Script execution indicators in response content
  • DOM manipulation via client-side JavaScript
  • Stored payload retrieval from backend storage
  • Context-specific injection (HTML body, attributes, JavaScript, CSS, URLs)

Vulnerability Types Covered

1. Reflected XSS / Non-Persistent XSS / Type 1 (CWE-79)

Payload is reflected directly from request to response without storage.

Detection Methods:

  • Inject <script>alert(1)</script> in parameters, observe in response body
  • Check if payload appears unencoded (<script> not converted to &lt;script&gt;)

Example Attack:

GET /search?q=<script>alert(1)</script>
Response: <p>Results for: <script>alert(1)</script></p>

2. Stored XSS / Persistent XSS / Type 2 (CWE-79)

Payload is stored server-side and served to other users.

Detection Methods:

  • Submit payload via form/API, retrieve via separate request
  • Check if payload persists and reflects to other users/sessions

Example Attack:

POST /comments {"body": "<script>alert(1)</script>"}
GET /comments → Response includes stored script

3. DOM-Based XSS / Type 0 (CWE-79)

Payload is injected via client-side JavaScript manipulating the DOM.

Detection Methods:

  • Inject payload in URL fragment (#<script>...)
  • Inject via location.hash, document.URL, document.referrer
  • Look for dangerous sinks: innerHTML, document.write, eval

Example Attack:

GET /page#<img src=x onerror=alert(1)>
Client JS: document.getElementById('output').innerHTML = location.hash.slice(1);

4. Basic XSS (CWE-80)

Simple script tag injection in HTML body.

Detection: <script>alert(1)</script> reflected unencoded.

5. Error Message XSS (CWE-81)

XSS in application error pages/messages.

Detection: Inject payload that triggers error, check error page for reflection.

6. Attribute Context XSS (CWE-83)

Payload breaks out of HTML attribute context.

Detection Methods:

  • " onmouseover="alert(1) — break double-quoted attribute
  • ' onfocus='alert(1) — break single-quoted attribute
  • " autofocus onfocus="alert(1) — auto-triggering

Example:

<input value="USER_INPUT" />
Payload: " onfocus="alert(1)" autofocus="
Result: <input value="" onfocus="alert(1)" autofocus="" />

7. URI Scheme XSS (CWE-84)

Injection via javascript: or data: URI schemes.

Detection: javascript:alert(1) in href/src attributes.

Example:

<a href="USER_INPUT">Click</a>
Payload: javascript:alert(1)
Result: <a href="javascript:alert(1)">Click</a>

8. Doubled Character XSS (CWE-85)

Bypass filters using doubled/nested characters.

Detection: <<script>script>alert(1)<</script>/script> bypasses naive stripping.

9. Invalid Character XSS (CWE-86)

Injection using invalid/special Unicode characters.

Detection: Null bytes, UTF-7, charset confusion attacks.

10. Alternate XSS Syntax (CWE-87)

Non-standard XSS vectors that bypass filters.

Detection Methods:

  • <svg onload=alert(1)>
  • <img src=x onerror=alert(1)>
  • <body onload=alert(1)>
  • <iframe src="javascript:alert(1)">
  • Template literals: `${alert(1)}`

Context-Specific Notes

Context Encoding Required Payload Examples
HTML Body HTML entity encoding <script>alert(1)</script>
HTML Attribute Attribute encoding + quote escape " onmouseover="alert(1)
JavaScript String JavaScript string escaping ';alert(1)// or </script><script>alert(1)
JavaScript Template Template literal escaping ${alert(1)}
URL Parameter URL encoding javascript:alert(1)
CSS Value CSS escaping expression(alert(1)) (legacy IE)

Prerequisites

  • Target application running and reachable
  • Identified injection points (URL params, form fields, headers, cookies)
  • Browser or headless browser for DOM-based XSS validation
  • VULNERABILITIES.json with suspected XSS findings if provided

Testing Methodology

Phase 1: Identify Injection Points

  • URL query parameters
  • POST body fields (form data, JSON)
  • HTTP headers (User-Agent, Referer, X-Forwarded-For)
  • Cookies
  • Path segments
  • File upload names/metadata

Key Insight: Any user input that appears in HTML output is a potential XSS vector.

Phase 2: Determine Context

Analyze where input is reflected:

  • HTML body: Between tags
  • HTML attribute: Inside tag attributes
  • JavaScript: Inside <script> blocks or event handlers
  • URL: In href, src, action attributes
  • CSS: In style attributes or <style> blocks

Phase 3: Establish Baseline

  • Send normal request; record response content
  • Identify where user input appears in response
  • Check existing encoding/s
Полный SKILL.md на GitHub

Установить xss-testing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Bash

Вложенные файлы

examples.mdreference/README.mdreference/validate_xss.pyreference/xss_payloads.py

FAQ

Что делает скилл xss-testing?

Validate Cross-Site Scripting (XSS) vulnerabilities including Reflected, Stored, and DOM-based XSS. Test by injecting script payloads into user-controlled inputs and observing if they execute in browser context. Use when testing CWE-79 (XSS), CWE-80 (Basic XSS), CWE-81 (Error Message XSS), CWE-83 (Attribute XSS), CWE-84 (URI Scheme XSS), CWE-85 (Doubled Character XSS), CWE-86 (Invalid Character XSS), CWE-87 (Alternate XSS Syntax), or related XSS findings.

Как установить скилл xss-testing?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл xss-testing запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить xss-testing с