Loopus

Pro Content

This lesson requires Loopus Pro access. Upgrade to unlock all courses, labs, and challenges.

Web Application HackingServer-Side Vulnerabilities

XXE Injection

25 min
lab
+60 XP

Learning Objectives

  • Understand XML External Entity injection
  • Learn to exploit XXE for file disclosure
  • Master blind XXE techniques

XXE Injection

XML External Entity (XXE) injection exploits XML parsers that process external entity references. This vulnerability can lead to file disclosure, SSRF, denial of service, and in some cases remote code execution.

Understanding XML Entities

XML allows defining entities which are essentially variables that get expanded during parsing. External entities reference content from URLs or files using SYSTEM keyword.

Basic XXE Exploitation

File Disclosure


Define an external entity pointing to local files like /etc/passwd, then reference it in document content. The parser reads and includes the file contents.

SSRF via XXE


External entities can reference HTTP URLs, enabling server-side requests to internal services.

Blind XXE

When output is not displayed, use out-of-band techniques. Reference an external DTD hosted on attacker server that defines entities exfiltrating data via HTTP or DNS requests.

Finding XXE Vulnerabilities

Look for XML processing in API endpoints accepting XML, file upload features (DOCX, XLSX, SVG), SAML authentication, RSS/Atom feed processors, and SOAP web services.

Prevention

Secure XML parsing requires disabling external entities in XML parsers, using JSON instead of XML when possible, validating and sanitizing XML input, and updating XML libraries regularly.

Answer the Questions0 / 4 completed

📚 KnowledgeQuestion 1

What vulnerability abuses XML parsers?

Format: ***(3 chars)
Exact match required
⌨️ Hands-OnQuestion 2

What XML element declares external entities?

Format: ******(6 chars)
Exact match required
📚 KnowledgeQuestion 3

What type of entity retrieves data out of band?

Format: *****(5 chars)
Exact match required
⌨️ Hands-OnQuestion 4

What keyword defines an external entity source?

Format: ******(6 chars)
Exact match required
Answer all questions correctly to unlock the next lesson

Interactive Sandbox

Loading sandbox...

Submit Flag

Found the flag? Submit it below to complete this lesson.
Format: LOOPUS{...}

Previous
Answer all questions to continue