AlwaysInstallElevated – MSI Installer Privilege Escalation
AlwaysInstallElevated is a Windows policy that allows unprivileged users to install MSI packages with SYSTEM privileges. When both the machine and user registry keys are set to 1, any user can run an MSI file that executes as SYSTEM. This is a straightforward misconfiguration — confirm both keys, generate a malicious MSI, install it.
Prerequisites Check
Both registry keys must be set to 1 — check both:
Both must return 0x1. If either is missing or 0x0, the policy is not active and this technique does not apply.
Using PowerUp:
winPEAS also checks this automatically:
Step 1 — Generate a Malicious MSI
Add admin user (no listener required):
Reverse shell:
Meterpreter:
Step 2 — Transfer the MSI to Target
Or via PowerShell:
Step 2 — Transfer the MSI to Target
Or via PowerShell:
Step 3 — Install the MSI
Start your listener if using a reverse shell:
Install the MSI as the current unprivileged user — it automatically elevates to SYSTEM:
/quiet suppresses the UAC prompt. /qn means no UI. The MSI installs as SYSTEM due to the policy.
Step 4 — Verify
If you used the add-user payload:
Authenticate as the new admin:
Using Metasploit
Warning
This may be restricted in exams such as OSCP. Verify exam rules before use.
PowerUp One-Step Exploitation
Cleanup
Remove the MSI and the added user after escalating:
References
-
AlwaysInstallElevateddocs.microsoft.com/en-us/windows/win32/msi/alwaysinstallelevated (opens in new tab)
Microsoft Docs Policy description and registry key locations.
-
Get-RegistryAlwaysInstallElevated Automated detection and exploitation via Write-UserAddMSI.
Was this helpful?
Your feedback helps improve this page.