Windows User and Group Enumeration
Why This Is the Critical First Step
Before attempting any privilege escalation technique, you must understand the security context you are operating in. User and group enumeration answers the fundamental questions:
- Who am I? — What account do I currently have?
- What can I do? — What privileges and group memberships does this account carry?
- Who else is here? — What other users and groups exist on this system?
- Who has power? — Which accounts are administrators or members of privileged groups?
Skipping this step is the #1 reason candidates waste time on the OSCP exam. You might spend 20 minutes trying a kernel exploit when whoami /all would have revealed you already have SeImpersonatePrivilege and could use JuicyPotato in 2 minutes.
Exam Tip: Always run
whoami /allimmediately after gaining initial access. Screenshot or save the output. It is your single most important piece of intelligence.
Core Enumeration Commands
whoami — Know Yourself
The whoami command family is your primary reconnaissance tool. Each variant reveals different layers of your security context.
whoami — Basic Identity
whoami
Output:
WORKGROUP\student
This tells you the domain/workgroup and username. Simple, but essential.
whoami /groups — Token Group Memberships
whoami /groups
Output:
GROUP INFORMATION
-----------------
Group name SID Attributes
========================================= =============== ==================================================
Everyone S-1-1-0 Mandatory group, Enabled by default, Enabled group
BUILTIN\Users S-1-5-32-545 Mandatory group, Enabled by default, Enabled group
BUILTIN\Performance Log Users S-1-5-32-559 Mandatory group, Enabled by default, Enabled group
BUILTIN\Remote Desktop Users S-1-5-32-555 Mandatory group, Enabled by default, Enabled group
CONSOLE LOGON S-1-2-1 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Authenticated Users S-1-5-11 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\This Organization S-1-5-113-48815... Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Local account S-1-5-113 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Local account and member of...S-1-5-114 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NTLM Authentication S-1-5-64-10 Mandatory group, Enabled by default, Enabled group
Mandatory Label\Medium Mandatory Level S-1-16-8192 Mandatory Label
Key things to look for:
BUILTIN\Administrators(S-1-5-32-544) — If present, you already have admin-level accessBUILTIN\Backup Operators(S-1-5-32-551) — Can backup/restore all files, potential privesc vectorMandatory Label\Medium Mandatory Level— Your integrity level (see Privilege Levels topic)CONSOLE LOGONvsREMOTE LOGON— Tells you how you authenticated
whoami /priv — Enabled Privileges
whoami /priv
Output:
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State
========================================= ========================================= =======
SeShutdownPrivilege Shut down the system Disabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeUndockPrivilege Remove computer from docking station Disabled
SeIncreaseWorkingSetPrivilege Increase a process working set Disabled
SeImpersonatePrivilege Impersonate a client after authentication Enabled
SeCreateGlobalPrivilege Create global objects Enabled
This is arguably the most important output for privesc. Each privilege maps directly to an attack vector:
| Privilege | State | Attack Enabled |
|---|---|---|
SeImpersonatePrivilege |
Enabled | JuicyPotato, RoguePotato, PrintSpoofer, Named Pipe impersonation |
SeAssignPrimaryTokenPrivilege |
Enabled | RottenPotato, primary token manipulation |
SeDebugPrivilege |
Enabled | Process injection, token theft, read any process memory |
SeBackupPrivilege |
Enabled | Read any file regardless of ACL (via backup APIs), SAM hive extraction |
SeRestorePrivilege |
Enabled | Write any file regardless of ACL, create/modify services |
SeTakeOwnershipPrivilege |
Enabled | Take ownership of any object, then grant yourself full control |
SeLoadDriverPrivilege |
Enabled | Load arbitrary kernel drivers (kernel privesc) |
SeRelabelPrivilege |
Enabled | Modify integrity labels on objects |
SeCreateTokenPrivilege |
Enabled | Create primary tokens — essentially SYSTEM-level power |
SeTcbPrivilege |
Enabled | Act as part of the OS — can act on behalf of any user |
SeProfileSingleProcessPrivilege |
Enabled | Profile any process — potential info leak |
SeIncreaseQuotaPrivilege |
Enabled | Modify memory quotas — rarely exploitable directly |
Exam Tip: If you see
SeImpersonatePrivilegeas Enabled, immediately think: JuicyPotato → RoguePotato → PrintSpoofer → JuicyPotatoNG. This is the most common privesc path on OSCP Windows boxes.
whoami /all — Everything at Once
whoami /all
This combines all information: user identity, group memberships, privileges, integrity level, logon type, and more. Always run this first.
Full example output:
user name
=======================
workgroup\student
user's groups
=======================
Group Name Type SID Attributes
========================================== ================ ============ ==================================================
Everyone Well-known group S-1-1-0 Mandatory group, Enabled by default, Enabled group
BUILTIN\Users Alias S-1-5-32-545 Mandatory group, Enabled by default, Enabled group
BUILTIN\Performance Log Users Alias S-1-5-32-559 Mandatory group, Enabled by default, Enabled group
CONSOLE LOGON Well-known group S-1-2-1 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NETWORK Well-known group S-1-5-2 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Authenticated Users Well-known group S-1-5-11 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\This Organization Well-known group S-1-5-113 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NTLM Authentication Well-known group S-1-5-64-10 Mandatory group, Enabled by default, Enabled group
Mandatory Label\Medium Mandatory Level Label S-1-16-8192
user claim values
=======================
<none>
user's privileges
=======================
Privilege Name Description State
============================= ==================================== ========
SeShutdownPrivilege Shut down the system Disabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeUndockPrivilege Remove computer from docking station Disabled
SeIncreaseWorkingSetPrivilege Increase a process working set Disabled
net user — Enumerate All Users
List All Users
net user
Output:
User accounts for \\TARGET
-------------------------------------------------------------------------------
admin DefaultAccount DefaultFirstUser guest student
WDAGUtilityAccount
The command completed successfully.
Detailed User Information
net user <username>
Output:
User name student
Full Name Student Account
Comment Test user account
User's comment
Country/region code 000 (System Default)
Account active Yes
Account expires Never
Password last set 8/15/2025 3:42:18 PM
Password expires Never
Password changeable 8/15/2025 3:42:18 PM
Password required Yes
User may change password Yes
Workstations allowed All
Logon script
User profile
Home directory
Last logon 8/20/2025 10:15:33 AM
Logon hours allowed All
Local Group Memberships *Users
Global Group memberships *None
The command completed successfully.
Key fields to note:
Account active— Is the account enabled?Password expires— Does the password have an expiration?Last logon— When was this account last used? Active accounts are better targets.Local Group Memberships— What groups is this user in? This is gold.Password required— Can this account log in without a password?
Enumerate All Users in a Loop
for /f "tokens=1-3" %a in ('net user ^| findstr /b /c:"---" /v ^| more') do @net user %a 2>nul | findstr /c:"Full Name" /c:"Comment" /c:"Password expires" /c:"Local Group Memberships"
Or in PowerShell:
Get-LocalUser | ForEach-Object {
Write-Host "=== $($_.Name) ===" -ForegroundColor Cyan
$_ | Select-Object Name, Enabled, LastLogon, PasswordLastSet
}
net localgroup — Enumerate Groups
List All Local Groups
net localgroup
Output:
Local groups of \\TARGET
-------------------------------------------------------------------------------
Administrators
Backup Operators
Cryptographic Operators
Database Operators
Device Owners
Distributed COM Users
Event Log Readers
Guests
Hyper-V Administrators
IIS_IUSRS
Network Configuration Operators
Performance Log Users
Performance Monitor Users
Power Users
Print Operators
Remote Desktop Users
Remote Management Users
Replicator
Server Operators
Storage Replica Managers
Users
Windows Management Infrastructure
WinRMRemoteWMIUsers__
The command completed successfully.
View Members of a Specific Group
net localgroup <groupname>
Most important — check Administrators:
net localgroup Administrators
Output:
Alias name Administrators
Comment Administrators have complete and unrestricted access to the computer/domain
Members
-------------------------------------------------------------------------------
admin
DefaultFirstUser
student
The command completed successfully.
If your user appears here, you may already have admin-level access. Check further with whoami /priv.
Other critical groups to check:
net localgroup "Backup Operators"
net localgroup "Remote Desktop Users"
net localgroup "Server Operators"
net localgroup "Account Operators"
net localgroup "Print Operators"
net accounts — Password Policy
net accounts
Output:
Computer property:
Minimum password length: 0
Length of password history maintained: 0
Force logoff when logon hours expire: No
Lockout threshold: 0
Lockout duration (minutes): 30
Lockout observation window (minutes): 30
Maximum password age (days): 0
Minimum password age (days): 0
Machine password age (days): 30
User property:
Domain is currently synced for password directory policies: No
The command completed successfully.
Why this matters:
Minimum password length: 0— No password complexity. Brute force is trivial.Lockout threshold: 0— No account lockout. Unlimited password guessing.Maximum password age: 0— Passwords never expire.Length of password history: 0— Users can reuse old passwords.
These settings make password-based attacks (brute force, dictionary attacks) much more viable.
PowerShell Equivalents
PowerShell provides richer, more structured enumeration. These commands work on Windows 8 / Server 2012 and later.
Get-LocalUser
Get-LocalUser
Output:
Name Enabled LastLogon PasswordLastSet PasswordExpires
---- ------- --------- --------------- ---------------
admin True 8/20/2025 10:15:33 AM 8/15/2025 3:42:18 PM 8/15/2026 3:42:18 PM
DefaultAccount False 1/1/0001 12:00:00 AM 1/1/0001 12:00:00 AM 1/1/0001 12:00:00 AM
student True 8/20/2025 9:30:00 AM 8/15/2025 3:42:18 PM 8/15/2026 3:42:18 PM
DefaultFirstUser True 8/18/2025 2:00:00 PM 8/15/2025 3:42:18 PM 8/15/2026 3:42:18 PM
Detailed view:
Get-LocalUser | Select-Object Name, Enabled, LastLogon, PasswordLastSet, Description | Format-Table -AutoSize
Get-LocalGroup
Get-LocalGroup
Output:
Name Description
---- -----------
Administrators Members...
Users Members...
Guests Members...
Get-LocalGroupMember
Get-LocalGroupMember -Group "Administrators"
Output:
ObjectClass Name PrincipalSource
----------- ---- ---------------
User admin Local
User DefaultFirstUser Local
User student Local
Enumerate all groups and their members:
Get-LocalGroup | ForEach-Object {
$group = $_.Name
$members = Get-LocalGroupMember -Group $group -ErrorAction SilentlyContinue
if ($members) {
Write-Host "=== $group ===" -ForegroundColor Yellow
$members | ForEach-Object { Write-Host " - $($_.Name) ($($_.PrincipalSource))" }
}
}
Get Current User SID via PowerShell
[System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value
Output:
S-1-5-21-3298345672-1834567890-2603456789-1001
SIDs — Security Identifiers
SID Structure
Every Windows security principal (user, group, computer) has a unique Security Identifier (SID). Understanding SID structure is essential for privesc.
Format: S-Revision-Authority-SubAuthority1-SubAuthority2-...-RID
Example: S-1-5-21-3298345672-1834567890-2603456789-1001
| Component | Value | Meaning |
|---|---|---|
S |
— | Indicates this is a SID |
1 |
Revision | SID revision level (always 1) |
5 |
Authority | NT Authority (Microsoft) |
21-3298345672-1834567890-2603456789 |
Sub-Authorities | Unique domain/machine identifier (random per installation) |
1001 |
RID | Relative Identifier — unique within the domain |
Well-Known SIDs Reference Table
These SIDs are consistent across all Windows installations:
| SID | Name | Description | Privesc Relevance |
|---|---|---|---|
S-1-0 |
Null Authority | No security context | — |
S-1-0-0 |
Null | No principal | — |
S-1-1 |
World Authority | Everyone | — |
S-1-1-0 |
Everyone | All users | ACL check target |
S-1-2-1 |
Console Logon | User logged on at console | Logon type indicator |
S-1-2-2 |
Package | UWP package | — |
S-1-3 |
Creator Authority | Object creators | — |
S-1-5 |
NT Authority | Windows NT | — |
S-1-5-1 |
Dialup | Dial-up users | — |
S-1-5-2 |
Network | Network logon users | Logon type indicator |
S-1-5-3 |
Batch | Batch logon users | — |
S-1-5-4 |
Interactive | Interactive logon | — |
S-1-5-6 |
Service | Service logon | — |
S-1-5-7 |
Anonymous | Anonymous logon | — |
S-1-5-8 |
Proxy | Proxy logon | — |
S-1-5-9 |
Enterprise Domain Controllers | DCs in forest | Domain privesc |
S-1-5-10 |
Principal Self | The principal itself | — |
S-1-5-11 |
Authenticated Users | All authenticated users | ACL check target |
S-1-5-12 |
Restricted Code | Restricted code | — |
S-1-5-18 |
LOCAL SYSTEM | NT AUTHORITY\SYSTEM | Highest privilege — privesc target |
S-1-5-19 |
LOCAL SERVICE | NT AUTHORITY\LOCAL SERVICE | Service account |
S-1-5-20 |
NETWORK SERVICE | NT AUTHORITY\NETWORK SERVICE | Service account |
S-1-5-32-544 |
Administrators | BUILTIN\Administrators | Admin group — check membership |
S-1-5-32-545 |
Users | BUILTIN\Users | Standard users |
S-1-5-32-546 |
Global Users | Domain global users | — |
S-1-5-32-547 |
Guests | BUILTIN\Guests | Minimal access |
S-1-5-32-548 |
Computer Management Operators | — | — |
S-1-5-32-549 |
Terminal Server Users | RDP users | — |
S-1-5-32-550 |
Account Operators | BUILTIN\Account Operators | Can create/modify user accounts |
S-1-5-32-551 |
Backup Operators | BUILTIN\Backup Operators | Can bypass file ACLs via backup |
S-1-5-32-552 |
Replicators | BUILTIN\Replicators | File replication — rare privesc |
S-1-5-32-554 |
Pre-Windows 2000 Compatible Access | — | Read access to user objects |
S-1-5-32-555 |
Remote Desktop Users | BUILTIN\Remote Desktop Users | RDP access |
S-1-5-32-556 |
Network Configuration Operators | — | Network config access |
S-1-5-32-557 |
Incoming Forest Trust Builders | — | Domain trust manipulation |
S-1-5-32-558 |
Performance Monitor Users | — | Performance data access |
S-1-5-32-559 |
Performance Log Users | BUILTIN\Performance Log Users | Perfmon data access |
S-1-5-32-560 |
Windows Management Infrastructure | WMI Users | WMI remote management |
S-1-5-32-561 |
Encryption Domain Users | — | EFS encryption |
S-1-5-32-562 |
Remote Management Users | — | WinRM access |
S-1-5-32-568 |
Storage Replica Administrators | — | Storage management |
S-1-5-32-574 |
Cloud Domain Controllers | — | Azure AD hybrid |
S-1-5-80-0 |
All Services | Virtual accounts for services | — |
S-1-16-0 |
Untrusted Mandatory Level | IL = Untrusted | Low-IL process |
S-1-16-4096 |
Low Mandatory Level | IL = Low | Protected mode browsers |
S-1-16-8192 |
Medium Mandatory Level | IL = Medium | Standard user process |
S-1-16-8448 |
Medium-Plus Mandatory Level | IL = Medium+ | — |
S-1-16-12288 |
High Mandatory Level | IL = High | Elevated process |
S-1-16-16384 |
High-Plus Mandatory Level | IL = High+ | — |
S-1-16-20480 |
System Mandatory Level | IL = System | SYSTEM processes |
S-1-16-28672 |
Protected Process Mandatory Level | IL = Protected | Antivirus, secure processes |
S-1-16-32768 |
Secure Process Mandatory Level | IL = Secure | Highest integrity |
RID Patterns to Know
| RID | Account | Description |
|---|---|---|
500 |
First admin account | The built-in Administrator (renamed on modern Windows) |
501 |
Guest | Built-in Guest account |
503 |
DefaultFirstUser | Default user on Windows 10+ OOBE |
504 |
DefaultAccount | Default account on Windows 10+ |
1000+ |
Regular users | User-created accounts start at 1000 |
Exam Tip: RID 500 is the built-in Administrator. Even if renamed,
net user administratoror checking RID 500 can reveal the actual admin account name.
Important Groups — Deep Dive
Administrators (S-1-5-32-544)
- Privileges: Full system control, install software, modify any file, manage services, access all objects
- Default members: Built-in Administrator account
- Abuse: If you are a member, you can escalate to SYSTEM via
psexec -s cmd.exe, modify any service, or use any privesc technique that requires admin rights - Check:
net localgroup Administrators
Users (S-1-5-32-545)
- Privileges: Standard user rights, run applications, own personal files
- Default members: All regular user accounts
- Abuse: Limited — this is your starting point. You need to find misconfigurations to escalate.
Backup Operators (S-1-5-32-551)
- Privileges: Can back up and restore all files on the system regardless of ACLs
- Abuse vectors:
- SAM Hive Extraction: Use backup APIs to copy
C:\Windows\System32\config\SAMandSYSTEM, then extract password hashes withsecretsdump.pyorsamdump2 - NTDS.dit Extraction: On domain controllers, extract the entire Active Directory database
- Shadow Copy Abuse: Create volume shadow copies and copy protected files
- SAM Hive Extraction: Use backup APIs to copy
- Key commands:
# Create shadow copy vssadmin create shadow /for=C: # List shadow copies vssadmin list shadows # Access shadow copy copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SAM .
Remote Desktop Users (S-1-5-32-555)
- Privileges: Can log in via Remote Desktop Protocol (RDP)
- Abuse vectors:
- If you have credentials for a user in this group, you can RDP in for a richer shell
- Combined with credential dumping, this enables persistent remote access
- RDP sessions run at High Integrity Level, opening more attack surfaces
Performance Log Users (S-1-5-32-559)
- Privileges: Can assign performance log and alert objects to directories and files
- Abuse vectors:
- Can create performance monitor data collector sets that write to arbitrary locations
- Can potentially read files through performance counter logging
- Lower priority target but worth noting
Distributed COM Users (S-1-5-32-557)
- Privileges: Can access DCOM objects
- Abuse vectors:
- DCOM objects often run with higher privileges
- JuicyPotato and similar tools exploit DCOM impersonation
- Being in this group alone doesn’t grant much, but combined with
SeImpersonatePrivilegeit enables COM-based attacks
IIS_IUSRS (S-1-5-32-578)
- Privileges: IIS application pool identity
- Abuse vectors:
- If you compromise a web application running under this identity
- Check for writable web directories, configuration files
- Look for application-specific vulnerabilities
WinRMRemoteWMIUsers__ (S-1-5-32-580)
- Privileges: Can connect via WinRM (Windows Remote Management) and WMI
- Abuse vectors:
- Remote PowerShell sessions:
Enter-PSSession -ComputerName TARGET -Credential USER - WMI execution:
wmic /node:TARGET process call create "cmd.exe" - File transfer over WinRM
- Remote PowerShell sessions:
Account Operators (S-1-5-32-550)
- Privileges: Can create, modify, and delete user and group accounts (but not in privileged groups)
- Abuse vectors:
- Create a new user account and add it to the Administrators group (if permissions allow)
- Modify existing user passwords
- Create accounts with specific SIDs for SID history attacks (domain environments)
Server Operators (S-1-5-32-549)
- Privileges: Can manage servers, including changing system time, shutting down, and managing shares
- Abuse vectors:
- Can modify NTLM authentication timestamps — potential Kerberos attacks
- Can create and manage shared folders
- Can restart services on Windows Server
Print Operators (S-1-5-32-550)
- Privileges: Manage printers and print jobs
- Abuse vectors:
- PrintNightmare (CVE-2021-34527): Print Operators can load arbitrary DLLs as SYSTEM
- Can modify printer driver paths to execute code as SYSTEM
- High-value target on modern Windows systems
Replicators (S-1-5-32-552)
- Privileges: Support file replication in domain environments
- Abuse vectors:
- Rarely exploitable directly
- In domain environments, may have access to SYSVOL replication
- Low priority but worth noting in domain scenarios
Token Types
Understanding token types is critical for token-based privilege escalation attacks.
Primary Token
- Definition: The main security token associated with a process
- Characteristics: Represents the process owner’s identity and privileges
- Usage: Every process has exactly one primary token
- Privesc relevance: Stealing a primary token from a SYSTEM process gives you SYSTEM privileges
Impersonation Token
- Definition: Created when a server process acts on behalf of a client
- Characteristics: Limited by impersonation level (see below)
- Usage: IIS, RPC servers, named pipe servers create these
- Privesc relevance: JuicyPotato, RoguePotato, and PrintSpoofer all exploit impersonation tokens to escalate to SYSTEM
Link Token
- Definition: A token that links to another token
- Characteristics: Rarely seen directly
- Usage: Internal Windows mechanism
- Privesc relevance: Low — mainly of theoretical interest
New Primary Token (from Impersonation)
- Definition: A primary token created by duplicating an impersonation token
- Characteristics: Full privileges of the impersonated identity
- Usage:
DuplicateTokenExAPI call - Privesc relevance: This is the mechanism used by Potato-family exploits — convert an impersonation token into a primary SYSTEM token
Impersonation Levels
| Level | Constant | Description | Privesc Impact |
|---|---|---|---|
SecurityAnonymous |
0 | Server cannot obtain any info about client | No impact |
SecurityIdentification |
1 | Server can query client identity but cannot impersonate | Limited |
SecurityImpersonation |
2 | Server can impersonate client in local system | Key level for Potato exploits |
SecurityDelegation |
3 | Server can impersonate client on remote systems | Highest impact — remote privesc possible |
Privilege Attributes from whoami /priv
Each privilege shown by whoami /priv has a state attribute:
| State | Meaning | Privesc Relevance |
|---|---|---|
| Enabled | The privilege is active and can be used immediately | Directly exploitable |
| Enabled By Default | The privilege exists but must be explicitly enabled | Can be enabled via AdjustTokenPrivileges API |
| Disabled | The privilege exists but cannot be enabled by this process | Not directly exploitable without admin rights |
Key Insight: A privilege that is “Enabled By Default” can often be activated by the process itself using the
AdjustTokenPrivilegesWindows API. Tools like Incognito can enumerate and activate these privileges.
Key Privileges and Their Attacks
SeImpersonatePrivilege
- Description: Impersonate a client after authentication
- Default holders: Everyone (non-admin users), IIS, services
- Attacks:
- JuicyPotato: Uses COM object impersonation to get SYSTEM token (Windows 7–10 1809)
- RoguePotato: Uses HTTP.SYS + Named Pipe, works on all Windows versions
- PrintSpoofer: Uses named pipe impersonation via spooler service (Windows 7–11)
- JuicyPotatoNG: Updated version with more CLSIDs and better compatibility
- Named Pipe Impersonation: Manual technique using Python or C
SeAssignPrimaryTokenPrivilege
- Description: Replace a process level token
- Default holders: Rarely given to non-admins
- Attacks:
- RottenPotato: Original token manipulation exploit (requires MS16-034 unpatched)
- Primary token theft and duplication
SeDebugPrivilege
- Description: Debug programs and access any process memory
- Default holders: Administrators
- Attacks:
- Read memory of lsass.exe to extract credentials (mimikatz)
- Inject code into high-privilege processes
- Token theft from SYSTEM processes
SeBackupPrivilege
- Description: Bypass file ACLs for backup operations
- Default holders: Backup Operators group
- Attacks:
- Copy SAM and SYSTEM hives for hash extraction
- Read any file on the system (including NTDS.dit on DCs)
- Use
ntfsutilor backup APIs to bypass ACLs
SeRestorePrivilege
- Description: Bypass file ACLs for restore operations
- Default holders: Backup Operators, Administrators
- Attacks:
- Write to any file on the system
- Replace system binaries
- Modify service configurations
SeTakeOwnershipPrivilege
- Description: Take ownership of any object
- Default holders: Administrators
- Attacks:
- Take ownership of protected files, then grant yourself full control
- Modify ACLs on critical system objects
SeLoadDriverPrivilege
- Description: Load and unload kernel drivers
- Default holders: Administrators
- Attacks:
- Load arbitrary kernel drivers for kernel-level privesc
- Exploit vulnerable signed drivers
SeRelabelPrivilege
- Description: Modify integrity labels on objects
- Default holders: Administrators
- Attacks:
- Lower integrity level of protected objects
- Modify Mandatory Integrity Control labels
Enumeration Flow Diagram
graph TD
A[Initial Access: Low Priv Shell] --> B[Run: whoami /all]
B --> C{Analyze Output}
C --> D[Check Group Memberships]
C --> E[Check Privileges]
C --> F[Check Integrity Level]
D --> D1{In Administrators?}
D1 -->|Yes| G[Already Elevated - Use psexec -s]
D1 -->|No| D2{In Backup Operators?}
D2 -->|Yes| H[SAM Extraction via Shadow Copy]
D2 -->|No| D3{In Other Privileged Group?}
D3 -->|Yes| I[Research Group-Specific Attacks]
D3 -->|No| J[Continue Enumeration]
E --> E1{SeImpersonatePrivilege?}
E1 -->|Enabled| K[JuicyPotato / RoguePotato / PrintSpoofer]
E1 -->|No| E2{SeDebugPrivilege?}
E2 -->|Enabled| L[Token Theft / Process Injection]
E2 -->|No| E3{SeBackupPrivilege?}
E3 -->|Enabled| H
E3 -->|No| J
F --> F1{Integrity Level}
F1 -->|High| M[More Attack Options Available]
F1 -->|Medium| N[Standard User Constraints]
F1 -->|Low| O[Very Limited - Need IL Bypass First]
J --> P[net user / net localgroup]
P --> Q[net accounts - Password Policy]
Q --> R[Map Complete Attack Surface]
style A fill:#ff9999
style G fill:#99ff99
style K fill:#99ff99
style H fill:#99ff99
style L fill:#99ff99
“What to Look For” Checklist
Use this checklist after running whoami /all:
- Am I in the Administrators group? → Use
psexec -s cmd.exeor any admin privesc - Do I have SeImpersonatePrivilege (Enabled)? → JuicyPotato / RoguePotato / PrintSpoofer
- Do I have SeAssignPrimaryTokenPrivilege? → RottenPotato / token manipulation
- Do I have SeDebugPrivilege? → Mimikatz / process injection / token theft
- Am I in Backup Operators? → SAM extraction via shadow copies
- Am I in Server Operators? → Service restart, share manipulation
- Am I in Account Operators? → Create admin user
- Am I in Print Operators? → PrintNightmare (CVE-2021-34527)
- What is my Integrity Level? → Determines what objects I can access
- What is my logon type? → Console vs Remote affects available attacks
- Are there other admin accounts? → Target for credential attacks
- What is the password policy? → Weak policy = brute force viable
Common Mistakes
Mistake 1: Running whoami Instead of whoami /all
whoami only shows your username. whoami /all shows groups, privileges, integrity level, and logon type. The difference is the difference between finding a privesc vector in 30 seconds and spending 30 minutes enumerating.
Mistake 2: Ignoring “Enabled By Default” Privileges
A privilege listed as “Enabled By Default” can often be activated programmatically. Don’t dismiss these — tools like Incognito can enumerate and activate them.
Mistake 3: Not Checking All Admin Accounts
Finding that admin is in the Administrators group is useful, but so is knowing that DefaultFirstUser is also an admin. Each admin account is a potential target for credential attacks.
Mistake 4: Forgetting About Service Accounts
NT AUTHORITY\SYSTEM, NT AUTHORITY\LOCAL SERVICE, and NT AUTHORITY\NETWORK SERVICE are built-in accounts. Services running as SYSTEM are prime targets for exploitation.
Mistake 5: Not Saving Output
In the OSCP exam, you need evidence. Always redirect output to files:
whoami /all > C:\temp\whoami_all.txt 2>&1
net user > C:\temp\net_user.txt 2>&1
net localgroup Administrators > C:\temp\admins.txt 2>&1
Quick Reference Command Cheat Sheet
# Essential first commands
whoami /all
net user
net localgroup Administrators
net accounts
# PowerShell alternatives (Win 8+/Server 2012+)
Get-LocalUser
Get-LocalGroup
Get-LocalGroupMember -Group "Administrators"
[System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value
# Detailed user info
net user <username>
net localgroup <groupname>
# Check specific groups for privesc
net localgroup "Backup Operators"
net localgroup "Server Operators"
net localgroup "Account Operators"
net localgroup "Print Operators"