XSLT to Code Execution

In this lab, you will leverage the ability to upload and process arbitrary XSL files in a vulnerable application to gain RCE on the target machine.

Objective: Leverage the XSLT code injection in the web application to identify the XSLT processor details and obtain a shell session on the target server to retrieve the flag from the target machine.

Webapp has the function to upload a XML and XSL file and then transform the file.

Use the below code for the XML and XSLT.

Viewing the result of the transformation.

Using the below transform, it is possible to view the vendor info.

The headers reveal that the application use PHP.Checked this by using the below XSL which executes the PHP sleep command

This transform can confirm this with the sleep command.

Base64 encode the below payload to avoid it being tampered when being uploaded via HTTP.

Final payload is below.

Last updated