Case Study: Craft CMS
Last updated
Was this helpful?
Last updated
Was this helpful?
The example below is based on OffSec's course.
The source code of the web application contains some clues. More specifically, it discloses that the Craft CMS is used and the use of []
in the name
attribute of the input
field indicates the usage of the PHP programming language (Figure 1).
Performing a dirbusting with , we find that there is an /admin
directory which further confirms that we are using the Craft CMS (Figure 2).
We can send an email containing a Twig-specific payload to form an out-of-band communication.
When we send the email the payload is executed and we receive a response back.
In the response, we confirm that we have achieved RCE.
The home page of the web application provides a way to send an email to the site's administrator. Emails are great targets for SSTI as they consist of mainly generic elements which are then tailored to the user using a templating engine. Searching for "" reveals that is used (Figure 3).
To exfiltrate data in Twig, we use the (~
) for string concatenation, which allows us to append the exfiltrated data to a GET
request and the tag to declare variables. Additionally, we apply the method method to the exfil
variable to ensure our payload is properly URL-encoded.
/admin
directory validates the usage of the Craft CMS.