Testing for server-side template injection
In this recipe, you will learn how to conduct a basic SSTI attack using a lab from PortSwigger Academy. Because of the insecure construction of an ERB template, the application in this lab is vulnerable to SSTI. You will learn what SSTI is by completing the lab. First, read the ERB documentation to learn how to run arbitrary code, then delete the morale.txt
file from Carlos’s home directory.
Furthermore, you will learn how server-side templates work and how this leads to attackers exploiting vulnerabilities to gain control over the server.
Getting ready
Start up your local ZAP tool and log in to your PortSwigger Academy account, then go to the Basic server-side template injection lab at https://portswigger.net/web-security/server-side-template-injection/exploiting/lab-server-side-template-injection-basic.
How to do it...
A good first step toward exploitation is to fuzz the template by injecting a sequence of special characters...