Always Install Elevated Uitgeschakeld

πŸ’Ό Management Samenvatting

De AlwaysInstallElevated beleid moet ALTIJD uitgeschakeld blijven omdat deze een triviale privilege escalation kwetsbaarheid introduceert waarmee standaard gebruikers volledige SYSTEM-level toegang kunnen verkrijgen.

Aanbeveling
Implementeer
Risico zonder
Critical
Risk Score
10/10
Implementatie
2u (tech: 1u)
Van toepassing op:
βœ“ Windows 10
βœ“ Windows 11
βœ“ Windows Server

KRITIEKE PRIVILEGE ESCALATION: AlwaysInstallElevated is een van de MEEST GEVAARLIJKE Windows configuraties. Wanneer Schakel ind op zowel HKLM als HKCU: Alle MSI installers worden uitgevoerd met SYSTEM privileges (hoogste niveau), Standaard gebruikers kunnen arbitrary code uitvoeren als SYSTEM, Geen UAC prompt (bypassed). ATTACK SCENARIO: Attacker heeft standaard user access (geen admin) β†’ Maakt malicious MSI file (bevat malware/ransomware) β†’ Executes MSI β†’ Installer runs as NT AUTHORITY\SYSTEM β†’ volledige admin privileges verkregen β†’ Domain compromise mogelijk. TRIVIAL EXPLOITATION: MSI files zijn makkelijk te maken (via WiX Toolset, InstallShield), Public exploits beschikbaar (Metasploit module), Penetration testers checken dit ALTIJD (low-hanging fruit), detectie: Simple registry check. REAL-WORLD USAGE: Ransomware gebruikt dit voor privilege escalation, APT groeps voor persistence, Red team assessments vinden dit frequent misConfigureerd. waarom Schakel inD IS CATASTROPHIC: Standaard users kunnen: Installeren van malware met SYSTEM privileges, Bypassen van application control (AppLocker/WDAC), Schakel uitn van antivirus, CreΓ«ren van beheerdersaccounts, Installeren van backdoors met volledige privileges. LEGITIMATE gebruiken CASE: NONE in moderne Windows. Enterprise software Implementeereerment moet via: Intune app Implementeereerment (controlled), SCCM/ConfigMgr (managed), Signed MSI packages via beheerde Implementeereerment. DEZE beleid MAG NOOIT Schakel inD ZIJN.

PowerShell Modules Vereist
Primary API: Intune / groep beleid
Connection: Registry
Required Modules:

Implementatie

Verificatie dat AlwaysInstallElevated Schakelt uit de is op beide locaties: HKLM:\SOFTWARE\beleidsregels\Microsoft\Windows\Installer\AlwaysInstallElevated moet NIET bestaan OF is 0, HKCU:\SOFTWARE\beleidsregels\Microsoft\Windows\Installer\AlwaysInstallElevated moet NIET bestaan OF is 0. KRITIEK: Beide registry keys moeten 0 zijn (of niet bestaan). Als één van beide is 1, is system KWETSBAAR. VERIFICATION: Controleer beide HKLM en HKCU keys, If ofwel is 1 (Schakel ind) is KRITIEKE beveiliging VULNERABILITY, If beide zijn 0 of niet-existent is veilige (compliant). REMEDIATION: Set beide keys to 0 (of delete keys), Investigate HOE deze Schakel ind werden (malware? misconfiguration?), Security scan voor exploitation evidence.

Vereisten

Voor verificatie en remediation:

  1. Windows 10, Windows 11, of Windows Server (alle versies)
  2. Administrator rechten voor registry verificatie
  3. Intune of groep beleid voor preventieve enforcement
  4. Security monitoring voor early detectie indien Schakel ind wordt

Implementeeratie

CRITICAL - Preventieve enforcement via Intune:

  1. Intune admin center β†’ Endpoint security β†’ Aanvalsoppervlak reduction
  2. Maak aan beleid β†’ Platform: Windows 10 en later
  3. Setting: Windows Installer β†’ AlwaysInstallElevated is Schakelt uit de (0)
  4. Scope: HKLM en HKCU (beide moeten Schakel uitd)
  5. Assign to: alle devices (geen uitzonderingen)
  6. monitor compliance: moet be 100%

Gebruik PowerShell-script always-install-elevated-Schakel uitd.ps1 (functie Invoke-Remediation) – Verificatie en remediation van AlwaysInstallElevated op HKLM en HKCU.

via groep beleid (on-premises):

  1. GPO: Computer Configuration β†’ Administrative Templates β†’ Windows Components β†’ Windows Installer
  2. beleid: 'Always install met elevated privileges' is Schakel uitd
  3. Ook: User Configuration β†’ Administrative Templates β†’ Windows Components β†’ Windows Installer
  4. beleid: 'Always install met elevated privileges' is Schakel uitd
  5. BEIDE beleidsregels moeten Schakelt uit de (Computer en User)

handmatige verificatie (voor immediate check):

  1. Run PowerShell als Administrator
  2. Controleer HKLM: Get-ItemProperty 'HKLM:\SOFTWARE\beleidsregels\Microsoft\Windows\Installer' -Name AlwaysInstallElevated -ErrorAction SilentlyContinue
  3. Controleer HKCU: Get-ItemProperty 'HKCU:\SOFTWARE\beleidsregels\Microsoft\Windows\Installer' -Name AlwaysInstallElevated -ErrorAction SilentlyContinue
  4. Expected: beide return NOTHING (key niet bestaat) of value is 0
  5. If ofwel returns 1: CRITICAL VULNERABILITY - remediate immediately

monitoring

Gebruik PowerShell-script always-install-elevated-disabled.ps1 (functie Invoke-Monitoring) – Controleren.

Kritieke monitoring (dagelijks):

  1. Automated registry scans: Controleer alle devices voor AlwaysInstallElevated is 1
  2. ALERT onmiddellijk indien gevonden (Deze is CRITICAL beveiligingsincident)
  3. Compliance dashboard: moet show 100% compliant (zero tolerance)
  4. Penetration testing: omvatten AlwaysInstallElevated Controleer in regular pentests
  5. Vulnerability scans: Nessus, Qualys, OpenVAS checken dit automatic

Incident indicators:

  1. Registry key plotseling appears met value 1 is possible malware activity
  2. MSI installations door standaard users zonder UAC prompt is exploitation in progress
  3. Unexpected SYSTEM-level processes is post-exploitation activity
  4. Event ID 1042 (Windows Installer elevated installation) van standard user is investigation VEREIST

Remediatie

Gebruik PowerShell-script always-install-elevated-disabled.ps1 (functie Invoke-Remediation) – Herstellen.

Als AlwaysInstallElevated Schakel inD is gevonden (KRITIEKE BEVEILIGINGSINCIDENT):

  1. ONMIDDELLIJKE ACTIE: Schakel uit beleid via registry (beide HKLM en HKCU keys is 0)
  2. ISOLATIE: Disconnect affected device van netwerk (Voorkom lateral movement)
  3. ONDERZOEK: HOE werd deze beleid Schakel ind? handmatige misconfiguration? Malware? Attacker?
  4. FORENSICS: Controleer Event Logs: Event ID 1042 (elevated MSI installations), Process creation logt (what MSI's were run?), netwerkverbindings (was er C2 communication?)
  5. MALWARE SCAN: volledige system scan met Defender/EDR (AlwaysInstallElevated vaak Schakel ind door malware)
  6. credential RESET: Assume compromise - reset machine account, user passwords
  7. REIMAGING CONSIDERATION: If exploitation suspected, clean reimage safer dan remediation
  8. ROOT CAUSE: Fix wat Schakel ind deze beleid (malware removal, GPO correction, Toegangscontrole en authenticaties)
  9. PREVENTIE: Zorg ervoor dat Intune/GPO beleid enforcement voorkomt re-Schakel inment

Compliance en Auditing

Deze control is VERPLICHT voor alle compliance frameworks:

  1. CIS Microsoft Windows Benchmark - control 18.9.85.1 & 18.9.85.2 (Computer & User) - Level 1 VERPLICHT
  2. BIO 12.06 - control van technische kwetsbaarheden: AlwaysInstallElevated is known critical vulnerability
  3. ISO 27001 A.12.6.1 - Management of technical vulnerabilities
  4. NIS2 Artikel 21 - Cybersecurity risicobeheer: Privilege escalation prevention
  5. NIST CSF PR.IP-1 - Baseline configuration maintained
  6. Essential Eight (Australia): Application hardening - Privilege escalation prevention

Compliance & Frameworks

Automation

Gebruik het onderstaande PowerShell script om deze security control te monitoren en te implementeren. Het script bevat functies voor zowel monitoring (-Monitoring) als remediation (-Remediation).

PowerShell
<# .SYNOPSIS Intune Security Options: Always Install Elevated Disabled .DESCRIPTION CIS - MSI install elevated moet disabled (security risk). .NOTES Filename: install-elevated.ps1|Author: Nederlandse Baseline voor Veilige Cloud|Registry: HKLM:\SOFTWARE\Policies\Microsoft\Windows\Installer\AlwaysInstallElevated|Expected: 0 #> #Requires -Version 5.1 #Requires -RunAsAdministrator [CmdletBinding()]param([switch]$WhatIf, [switch]$Monitoring, [switch]$Remediation, [switch]$Revert) $ErrorActionPreference = 'Stop'; $RegPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Installer"; $RegName = "AlwaysInstallElevated"; $ExpectedValue = 0 function Connect-RequiredServices { $p = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()); return $p.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) } function Test-Compliance { $r = [PSCustomObject]@{ScriptName = "install-elevated.ps1"; PolicyName = "Install Elevated"; IsCompliant = $false; CurrentValue = $null; ExpectedValue = "Disabled"; Details = @() }; function Invoke-Revert { Remove-ItemProperty -Path $RegPath -Name $RegName -ErrorAction SilentlyContinue } try { if (Test-Path $RegPath) { $v = Get-ItemProperty -Path $RegPath -Name $RegName -ErrorAction SilentlyContinue; if ($v -and $v.$RegName -eq $ExpectedValue) { $r.IsCompliant = $true; $r.Details += "Install elevated disabled" }else { $r.Details += "Install elevated enabled - CRITICAL RISK" } }else { $r.IsCompliant = $true; $r.Details += "Default: disabled" } }catch { $r.Details += "Error: $($_.Exception.Message)" }; return $r } function Invoke-Remediation { if (-not(Test-Path $RegPath)) { New-Item -Path $RegPath -Force | Out-Null }; Set-ItemProperty -Path $RegPath -Name $RegName -Value $ExpectedValue -Type DWord -Force; Write-Host "Always install elevated disabled" -ForegroundColor Green } function Invoke-Monitoring { $r = Test-Compliance; Write-Host "`n$($r.PolicyName): $(if($r.IsCompliant){'COMPLIANT'}else{'NON-COMPLIANT'})" -ForegroundColor $(if ($r.IsCompliant) { 'Green' }else { 'Red' }); return $r } function Invoke-Revert { Remove-ItemProperty -Path $RegPath -Name $RegName -ErrorAction SilentlyContinue } try { if (-not(Connect-RequiredServices)) { exit 1 }; if ($Monitoring) { $r = Invoke-Monitoring; exit $(if ($r.IsCompliant) { 0 }else { 1 }) }elseif ($Remediation) { if (-not $WhatIf) { Invoke-Remediation } }elseif ($Revert) { Invoke-Revert }else { $r = Test-Compliance; exit $(if ($r.IsCompliant) { 0 }else { 1 }) } }catch { Write-Error $_; exit 1 }

Risico zonder implementatie

Risico zonder implementatie
Critical: KRITIEK - HOOGSTE PRIORITEIT: AlwaysInstallElevated Schakel ind is TRIVIALE privilege escalation naar SYSTEM-level. Elke standaard gebruiker kan volledige admin privileges verkrijgen binnen seconden via malicious MSI. Dit is een BEKENDE kwetsbaarheid die actief wordt misbruikt door ransomware, malware en penetration testers. nul TOLERANCE - deze beleid mag NOOIT Schakel ind zijn. Indien gevonden tijdens scan is CRITICAL beveiligingsincident vereist immediate response.

Management Samenvatting

Zorg dat AlwaysInstallElevated ALTIJD Schakelt uit de is (beide HKLM en HKCU registry keys is 0 of niet-existent). Dit voorkomt triviale privilege escalation van standaard user naar SYSTEM. Verplicht voor CIS Level 1, BIO 12.06, ISO 27001 A.12.6.1, NIS2. Implementeeratie: 1-2 uur voor beleid Implementeereerment + monitoring. KRITIEKE VULNERABILITY PREVENTION - nul TOLERANCE.