AlwaysInstallElevated is a Windows Group Policy setting that allows any user to install MSI packages with SYSTEM privileges. When enabled, it's an instant privilege escalation - just install a malicious MSI and get SYSTEM.
Think of it like a "VIP installation pass" that Windows gives to everyone. Normally, installing software requires admin rights. With AlwaysInstallElevated, even low-privileged users can run installers as SYSTEM. We just need to give Windows a "malicious installer".
Both Keys Required
AlwaysInstallElevated must be set to 1 in BOTH HKLM and HKCU registry locations. If only one is set, the vulnerability doesn't exist. Always check both.
Checking for AlwaysInstallElevated
PowerShell Check
WinPEAS & PowerUp
Exploitation
Method 1: msfvenom MSI
Method 2: Installing the MSI
Method 3: PowerUp Automation
Creating Custom MSI
Pre-built MSIs
For most cases, msfvenom is sufficient. Custom MSI creation is rarely needed but useful for AV evasion or specific payload requirements.
AV Evasion Considerations
Complete Attack Example
AlwaysInstallElevated Methodology
AlwaysInstallElevated Exploitation
1
Check HKLMreg query for AlwaysInstallElevated = 1
2
Check HKCUreg query for AlwaysInstallElevated = 1
3
Generate MSImsfvenom with adduser or shell payload
4
TransferUpload MSI to target
5
Installmsiexec /quiet /qn /i evil.msi
6
AccessUse new admin creds or catch shell
Knowledge Check
Challenges
Key Takeaways
- AlwaysInstallElevated = install MSI packages as SYSTEM
- Must be set in BOTH HKLM and HKCU registry locations
- msfvenom generates MSI payloads easily
- msiexec /quiet /qn /i installs silently
- adduser payload avoids need for listener
- PowerUp's Write-UserAddMSI automates exploitation