> 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/cron-jobs/cron-expression-calculator.md).

# حاسبة تعبير Cron

ابحث عن تعبير كرون مثل `* * * * *`, `*/5 * * * *`, `0 0 * * *`، أو `@reboot` لقراءة جدوله وملاحظات اختبار الاختراق.

## مكتشف كرون

<table data-view="cards" data-full-width="true" data-search="true"><thead><tr><th>التعبير</th><th>المعنى</th><th>الاستخدام المعتاد</th><th>مراجعة الملاحظات</th></tr></thead><tbody><tr><td><code>* * * * *</code></td><td>كل دقيقة</td><td>مهمة متكررة سريعة</td><td>عالية القيمة لرفع الصلاحيات إذا كان السكربت قابلاً للكتابة.</td></tr><tr><td><code>*/2 * * * *</code></td><td>كل دقيقتين</td><td>مهمة استقصاء</td><td>استخدم pspy لمراقبة التنفيذ.</td></tr><tr><td><code>*/5 * * * *</code></td><td>كل 5 دقائق</td><td>فحوصات السلامة، مهام المزامنة</td><td>تحقّق من مسار الأمر والأهداف القابلة للكتابة.</td></tr><tr><td><code>*/10 * * * *</code></td><td>كل 10 دقائق</td><td>مهمة صيانة</td><td>ابحث عن المسارات النسبية و PATH غير الآمن.</td></tr><tr><td><code>*/15 * * * *</code></td><td>كل 15 دقيقة</td><td>مزامنة مجدولة</td><td>تحقّق من السجلات وملكية السكربت.</td></tr><tr><td><code>*/30 * * * *</code></td><td>كل 30 دقيقة</td><td>تنظيف دوري</td><td>راجع أوامر الحذف والحروف البدل.</td></tr><tr><td><code>0 * * * *</code></td><td>كل ساعة</td><td>مهمة ساعية</td><td>تحقّق من `/etc/cron.hourly` أيضًا.</td></tr><tr><td><code>30 * * * *</code></td><td>عند الدقيقة 30 من كل ساعة</td><td>إزاحة ساعية</td><td>راقب حول نصف الساعة.</td></tr><tr><td><code>0 */2 * * *</code></td><td>كل ساعتين</td><td>مهمة دفعات</td><td>تحقّق من السكربتات في أدلة النسخ الاحتياطي والمزامنة.</td></tr><tr><td><code>0 0 * * *</code></td><td>كل يوم عند منتصف الليل</td><td>تدوير يومي</td><td>تحقّق من `/etc/cron.daily` وسكربتات النسخ الاحتياطي.</td></tr><tr><td><code>30 2 * * *</code></td><td>كل يوم عند 02:30</td><td>صيانة ليلية</td><td>وقت شائع لمهام النسخ الاحتياطي الخاصة بـ root.</td></tr><tr><td><code>0 6 * * *</code></td><td>كل يوم عند 06:00</td><td>مهمة صباحية</td><td>تحقّق من توليد التقارير وسكربتات التنظيف.</td></tr><tr><td><code>0 0 * * 0</code></td><td>كل أحد عند منتصف الليل</td><td>مهمة أسبوعية</td><td>تحقّق من `/etc/cron.weekly`.</td></tr><tr><td><code>0 0 * * 1</code></td><td>كل اثنين عند منتصف الليل</td><td>مهمة أسبوعية</td><td>راجع سكربتات أسبوع العمل.</td></tr><tr><td><code>0 0 1 * *</code></td><td>اليوم الأول من كل شهر</td><td>تقارير شهرية</td><td>تحقّق من `/etc/cron.monthly`.</td></tr><tr><td><code>0 0 1 1 *</code></td><td>كل 1 يناير عند منتصف الليل</td><td>مهمة سنوية</td><td>منخفضة التكرار لكنها قد تعمل بصلاحيات root.</td></tr><tr><td><code>0 9-17 * * 1-5</code></td><td>كل ساعة من 09:00 إلى 17:00، من الاثنين إلى الجمعة</td><td>أتمتة ساعات العمل</td><td>تحقّق من السكربتات المملوكة للمستخدم المستخدمة بواسطة مهام الإدارة.</td></tr><tr><td><code>*/15 9-17 * * 1-5</code></td><td>كل 15 دقيقة خلال ساعات العمل</td><td>استقصاء خلال ساعات المكتب</td><td>نافذة هدف جيدة لـ pspy.</td></tr><tr><td><code>0 0,12 * * *</code></td><td>عند منتصف الليل وظهرًا</td><td>مهمة مرتين يوميًا</td><td>ساعات مفصولة بفواصل.</td></tr><tr><td><code>0 3 * * 1,3,5</code></td><td>عند 03:00 يوم الاثنين والأربعاء والجمعة</td><td>دفعة مجدولة</td><td>تحقّق من مطابقة يوم الأسبوع.</td></tr><tr><td><code>@reboot</code></td><td>عند بدء تشغيل النظام</td><td>سكربت بدء التشغيل</td><td>راجع آليات الاستمرارية وأوامر بدء التشغيل القابلة للكتابة.</td></tr><tr><td><code>@hourly</code></td><td>مرة كل ساعة</td><td>اختصار ساعي</td><td>مكافئ لـ `0 * * * *`.</td></tr><tr><td><code>@daily</code></td><td>مرة كل يوم</td><td>اختصار يومي</td><td>مكافئ لـ `0 0 * * *`.</td></tr><tr><td><code>@weekly</code></td><td>مرة كل أسبوع</td><td>اختصار أسبوعي</td><td>مكافئ لـ `0 0 * * 0`.</td></tr><tr><td><code>@monthly</code></td><td>مرة كل شهر</td><td>اختصار شهري</td><td>مكافئ لـ `0 0 1 * *`.</td></tr><tr><td><code>@yearly</code></td><td>مرة كل سنة</td><td>اختصار سنوي</td><td>مكافئ لـ `0 0 1 1 *`.</td></tr></tbody></table>

## حاسبة الحقول

```
* * * * *
| | | | |
| | | | +-- يوم الأسبوع: 0-7، الأحد هو 0 أو 7
| | | +---- الشهر: 1-12
| | +------ يوم الشهر: 1-31
| +-------- الساعة: 0-23
+---------- الدقيقة: 0-59
```

| المُعامل | المعنى      | مثال                                |
| -------- | ----------- | ----------------------------------- |
| `*`      | أي قيمة     | `* * * * *` كل دقيقة                |
| `,`      | قائمة القيم | `0 0,12 * * *` منتصف الليل وظهرًا   |
| `-`      | نطاق        | `0 9-17 * * *` كل ساعة من 09 إلى 17 |
| `/`      | خطوة        | `*/5 * * * *` كل 5 دقائق            |

## أوامر التعداد

```bash
crontab -l
cat /etc/crontab
ls -la /etc/cron.*
find /etc/cron* -type f -exec ls -la {} \\; 2>/dev/null
find /var/spool/cron -type f -exec ls -la {} \\; 2>/dev/null
systemctl list-timers --all
```

## قائمة التحقق لرفع الصلاحيات

| تحقق                                   | لماذا هذا مهم                                                |
| -------------------------------------- | ------------------------------------------------------------ |
| سكربت قابل للكتابة يُنفَّذ بواسطة root | مسار مباشر لتنفيذ أوامر بصلاحيات مرتفعة                      |
| مسار نسبي للأمر                        | قد يتيح اختطاف PATH التحكم في الملف التنفيذي الذي يتم تشغيله |
| أحرف البدل في الأدلة القابلة للكتابة   | حقن الخيارات ضد أدوات مثل `tar`                              |
| دليل كرون قابل للكتابة من الجميع       | زرع ملف أو استبدال سكربت                                     |
| مهمة root تعالج ملفات المستخدم         | حقن في المحلل أو في الأوامر عبر ملفات الإدخال                |
| مسارات كاملة مفقودة                    | سلوك يعتمد على البيئة                                        |
| تكشف السجلات الجدول                    | يساعد في التحقق الزمني وجمع الأدلة                           |


---

# 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/cron-jobs/cron-expression-calculator.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.
