> For the complete documentation index, see [llms.txt](https://blog.s1rn3tz.ovh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blog.s1rn3tz.ovh/pentest-web/injections/ssti.md).

# SSTI

## Basic

Etapes:

* Trouver des paramètres reflétés dans la page cible
* Tester des payloads génériques pour prouver la présence d'une SSTI

```
{{7*7}}
${7*7}
<%= 7*7 %>
${{7*7}}
#{7*7}

PHP based:
{php}print "HELLO"{/php}
```

* Exploiter (exemple de RCE: <%= system("whoami") %>)

### Enumération du moteur de template

2 possibilités:

* Tester des payloads génériques permet de trouver le moteur de template selon la synthaxe qui est acceptée.

![](/files/RBWQ2DwSykPrOJU5nbwM)

* Essayer de générer une erreur de syntaxe (Si le message d'erreur est trop verbeux, il peut faire fuiter le moteur de template utilisé).&#x20;

### Ressource: Payloads

{% embed url="<https://cheatsheet.hackmanit.de/template-injection-table/index.html>" %}

{% embed url="<https://book.hacktricks.xyz/pentesting-web/ssti-server-side-template-injection>" %}

{% embed url="<https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Template%20Injection#methodology>" %}

## Outils

### SSTImap

SSTimap est un outil de scan de vulnérabilité SSTI intéractif.

Ressource: <https://github.com/vladko312/SSTImap>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://blog.s1rn3tz.ovh/pentest-web/injections/ssti.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
