> 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/ssti/ssti-information-disclosure-via-python-user-objects.md).

# SSTI-Informationslecks über Python-User-Objekte

### Server-seitige Template-Injektion mit Informationspreisgabe über benutzerbereitgestellte Objekte

Das Ziel des Labs ist es, eine durch die Art und Weise verursachte SSTI auszunutzen, wie ein Objekt an das Template übergeben wurde, um sensible Daten abzurufen, insbesondere den geheimen Schlüssel des Frameworks. / Wir haben ein Konto: `content-manager: C0nt3ntM4n4g3r`.

#### Analyse und Identifizierung von ITST

Der erste Schritt besteht darin, einen Fehler in der Template-Engine mit dem folgenden Ausdruck zu verursachen:

```
{{}}
```

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

* Dies bestätigt, dass wir serverseitigen Template-Code injizieren können.

Versuchen Sie dann, mehr Debugging-Informationen anzuzeigen, indem Sie Folgendes injizieren:/ `{% debug %}`

```python
{% debug %}
```

* Allerdings erscheinen keine interessanten oder sensiblen Informationen in der Ausgabe.

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

#### Wiederherstellung des geheimen Schlüssels

* Da das an das Template übergebene Objekt Zugriff auf die Konfiguration gewährt, versucht man, den geheimen Schlüssel des Frameworks direkt über die Parameter auszulesen: / `{{settings.SECRET_KEY}}`

```python
{{settings.SECRET_KEY}}
```

<figure><img src="/files/03ac64eeec202249b702555ca3f44be0df7d8158" alt=""><figcaption></figcaption></figure>

* Dieser Ausdruck enthüllt den **geheimen Schlüssel** des Frameworks verwendet wird.

Dieser Wert wird dann zur Validierung an das Labor übermittelt.


---

# 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/ssti/ssti-information-disclosure-via-python-user-objects.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.
