UAC Restrictions Voor Lokale Accounts Op Netwerk Inloggen

💼 Management Samenvatting

UAC token filtering voor lokale accounts op netwerk inloggen voorkomt pass-the-hash lateral movement attacks waarbij aanvallers lokale admin credentials gebruiken om zich over het netwerk te verspreiden.

Aanbeveling
IMPLEMENT
Risico zonder
Critical
Risk Score
9/10
Implementatie
3u (tech: 1u)
Van toepassing op:
Windows 10
Windows 11
Windows Server

PASS-THE-HASH LATERAL MOVEMENT: Aanvallers compromitteren één machine → Dumpen lokale admin password hash (via Mimikatz) → Gebruiken deze hash om in te loggen op andere machines die DEZELFDE lokale admin credentials hebben → Lateral movement door hele netwerk. PROBLEEM: Veel organisaties gebruiken DEZELFDE lokale administrator password op alle machines (via golden image, handmatige sync, of LAPS niet geïmplementeerd). Als LocalAccountTokenFilterPolicy is 1 (MISCONFIGURED): Lokale beheerdersaccounts krijgen volledige admin privileges bij netwerk logon, Pass-the-hash works perfect, Lateral movement is triviaal. Als LocalAccountTokenFilterPolicy is 0 of niet-existent (SECURE): Lokale beheerdersaccounts krijgen FILTERED token bij netwerk logon (stripped van admin privileges), Pass-the-hash attacks falen (insufficient privileges), Lateral movement geblokkeerd. UITZONDERING: ingebouwde RID-500 Administrator account BYPASSED deze filtering altijd (reason: LAPS migratie of recovery scenarios). Daarom moet RID-500 uitgeschakeld zijn (separate control). REAL-WORLD IMPACT: Pre-mitigation: Ransomware compromises 1 machine → Pass-the-hash to 100+ machines binnen hours → volledige network versleuteling. Post-mitigation: Ransomware kan niet spread via local admin PTH → Breach contained. ALTERNATIVE: Microsoft LAPS (Local Administrator Password Solution) is unique random passwords per machine.

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

Implementatie

Zorg ervoor dat LocalAccountTokenFilterPolicy NIET ingeschakeld is: Registry: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\beleidsregels\System\LocalAccountTokenFilterPolicy. veilige STATE: Key NOT EXISTS (Standaard veilige behavior), OR: Key exists met value is 0 (explicit disable). VULNERABLE STATE: Key value is 1 (Schakelt in pass-the-hash, Schakelt uit UAC filtering). EFFECT VAN veilige CONFIGURATION (0 of niet-existent): Lokale beheerdersaccounts (behalve RID-500) krijgen filtered tokens bij netwerk logon, Remote admin actions via SMB/WMI/PSRemoting falen voor local admins, Forceert gebruik van domain accounts voor remote management (proper governance). COMPANION CONTROLS: Schakel uit ingebouwde Administrator (RID-500) - separate control, implementeren Microsoft LAPS voor unique local admin passwords, gebruiken domain accounts voor legitimate remote management.

Vereisten

  1. Windows 10, Windows 11, of Windows Server 2012+
  2. Microsoft LAPS deployed (AANBEVOLEN companion control)
  3. Domain accounts geconfigureerd voor remote management (alternative to local admins)
  4. ingebouwde Administrator (RID-500) disabled (separate control)

Implementatie

VERIFICATION (Standaard is veilige - Zorg ervoor dat niet misconfigured):

  1. Controleer registry: Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\beleidsregels\System' -Name LocalAccountTokenFilterPolicy -ErrorAction SilentlyContinue
  2. Expected: ERROR (key niet exists) is SECURE, OF: Value is 0 is SECURE
  3. VULNERABLE: Value is 1 is CRITICAL MISCONFIGURATION

Gebruik PowerShell-script apply-uac-restrictions-to-local-accounts-on-network-logons-is-set-to-enabled.ps1 (functie Invoke-Remediation) – Verifieer en remediate LocalAccountTokenFilterPolicy (Zorg ervoor dat is 0 of deleted).

via Intune:

  1. Intune: Zorg ervoor dat LocalAccountTokenFilterPolicy NIET set to 1
  2. Best practice: Delete key entirely (rely op Standaard veilige behavior)
  3. OR: expliciet set to 0 via aangepaste OMA-URI beleid

monitoring

Gebruik PowerShell-script apply-uac-restrictions-to-local-accounts-on-network-logons-is-set-to-enabled.ps1 (functie Invoke-Monitoring) – monitor LocalAccountTokenFilterPolicy status.

CRITICAL monitoring: Alert onmiddellijk indien LocalAccountTokenFilterPolicy is 1 detected (potential breach of misconfiguration)

Compliance en Auditing

  1. CIS Windows Benchmark - UAC restrictions
  2. BIO 12.02 - Malware/lateral movement prevention
  3. ISO 27001 A.9.2.3 - Privileged Toegangsbeheer
  4. NIS2 Artikel 21 - Lateral movement prevention

Remediatie

Gebruik PowerShell-script apply-uac-restrictions-to-local-accounts-on-network-logons-is-set-to-enabled.ps1 (functie Invoke-Remediation) – Herstellen.

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: UAC Restrictions Local Accounts Network .DESCRIPTION CIS - UAC restrictions voor local accounts op network logons. .NOTES Filename: uac-local-network.ps1|Author: Nederlandse Baseline voor Veilige Cloud|Registry: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\LocalAccountTokenFilterPolicy|Expected: 0 #> #Requires -Version 5.1 #Requires -RunAsAdministrator [CmdletBinding()]param([switch]$WhatIf, [switch]$Monitoring, [switch]$Remediation, [switch]$Revert) $ErrorActionPreference = 'Stop'; $RegPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"; $RegName = "LocalAccountTokenFilterPolicy"; $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 = "uac-local-net.ps1"; PolicyName = "UAC Local Network"; IsCompliant = $false; CurrentValue = $null; ExpectedValue = "Enabled"; Details = @() }; function Invoke-Revert { Remove-ItemProperty -Path $RegPath -Name $RegName -ErrorAction SilentlyContinue } try { $v = Get-ItemProperty -Path $RegPath -Name $RegName -ErrorAction SilentlyContinue; if (-not $v -or $v.$RegName -eq $ExpectedValue) { $r.IsCompliant = $true; $r.Details += "UAC restrictions enabled" }else { $r.Details += "UAC bypass enabled - RISK" } }catch { $r.Details += "Error: $($_.Exception.Message)" }; return $r } function Invoke-Remediation { Set-ItemProperty -Path $RegPath -Name $RegName -Value $ExpectedValue -Type DWord -Force; Write-Host "UAC restrictions for local accounts enabled" -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 indien LocalAccountTokenFilterPolicy is 1: Dit Schakelt uit UAC filtering en maakt mogelijk pass-the-hash lateral movement. Ransomware spreads binnen uren door hele netwerk. Zorg ervoor dat deze key is 0 of niet-existent.

Management Samenvatting

Zorg dat LocalAccountTokenFilterPolicy is 0 (of niet-existent) om UAC filtering te behouden en pass-the-hash lateral movement te blokkeren. implementeren Microsoft LAPS voor unique local admin passwords. Voldoet aan CIS, BIO 12.02, ISO 27001 A.9.2.3, NIS2. Implementatie: 1-3 uur. KRITIEKE ANTI-LATERAL-MOVEMENT CONTROL.