> 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/windows-vulnerabilities/scheduled-tasks.md).

# المهام المجدولة في Windows

تُعد المهام المجدولة أهدافًا مفيدة للتصعيد الامتيازي عندما تعمل الأتمتة بحساب ذي امتيازات لكنها تنفذ ملفًا أو برنامجًا نصيًا أو مسار أمر يمكن لمستخدم أقل امتيازًا تعديله.

## الاستكشاف

ابدأ بمخرجات مُجدول المهام المدمج:

```cmd
schtasks /query /fo LIST /v
```

يجعل PowerShell فحص إجراءات المهام أسهل:

```powershell
Get-ScheduledTask |
  ForEach-Object {
    [PSCustomObject]@{
      TaskName = $_.TaskName
      TaskPath = $_.TaskPath
      State = $_.State
      Author = $_.Author
      Actions = ($_.Actions | ForEach-Object { $_.Execute + " " + $_.Arguments }) -join "; "
    }
  }
```

## ما الذي يجعل المهمة مثيرة للاهتمام

ابحث عن المهام التي:

* تعمل فيها المهمة كـ `SYSTEM`، أو كمسؤول، أو كحساب خدمة.
* يشير الإجراء إلى برنامج نصي أو ملف تنفيذي خارج مسارات Windows المحمية.
* الملف الهدف أو أحد أدلةه الأصلية قابل للكتابة.
* تحتوي الوسائط على بيانات اعتماد أو مسارات شبكة أو رموز مميزة أو مفاتيح API.
* يمكن تشغيل المهمة يدويًا، أو تعمل بشكل متكرر، أو ستعمل عند تسجيل دخول المستخدم.

## تحقق من المسار الهدف

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

```cmd
icacls "C:\Path\To\task-script.ps1"
icacls "C:\Path\To"
```

```powershell
Get-Acl "C:\Path\To\task-script.ps1" | Format-List
```

المجموعات القابلة للكتابة مثل `المستخدمين`, `المستخدمون المصادق عليهم`، أو `الجميع` تكون مشبوهة عندما تعمل المهمة بامتيازات مرتفعة.

## تحقق بأمان

استخدم علامة غير ضارة أولًا لكي تثبت سياق التنفيذ دون كسر سير العمل المجدول.

```powershell
'whoami > C:\Windows\Temp\task-check.txt' | Out-File -Encoding ASCII C:\Path\To\task-script.ps1
```

شغّل المهمة إذا كان لدى المستخدم الخاص بك إذن:

```cmd
schtasks /run /tn "\Task\Name"
type C:\Windows\Temp\task-check.txt
```

إذا لم تتمكن من تشغيلها يدويًا، فدوّن وقت التشغيل التالي:

```cmd
schtasks /query /tn "\Task\Name" /fo LIST /v
```

## دلائل بيانات الاعتماد

يمكن للمهام كشف الأسرار من خلال وسائط الأوامر أو مسارات الشبكة المعينة.

```cmd
schtasks /query /fo LIST /v | findstr /i "password user runas /ru /rp \\\\"
```

```powershell
Get-ScheduledTask |
  Select-Object -ExpandProperty Actions |
  Select-String -Pattern 'password|passwd|pwd|token|secret|\\\\'
```

## تنظيف

أعد ملف الهدف الأصلي بعد الاختبار وأزل العلامات المؤقتة.

```cmd
del C:\Windows\Temp\task-check.txt
```

## النقاط الرئيسية

* حساب المهمة وأذونات الهدف أهم من اسم المهمة.
* عادةً ما يكون التحقق من برنامج نصي قابل للكتابة أنظف من استبدال ملف ثنائي.
* اجمع الأدلة: اسم المهمة، وحساب التشغيل، ومسار الإجراء، ومخرجات ACL، وشرط التشغيل.


---

# 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/windows-vulnerabilities/scheduled-tasks.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.
