Initial Enumeration
The minimum-viable enumeration suite for any Windows shell. Every command in this set produces high-signal information that maps directly to an escalation primitive: whoami /priv to token-abuse pages, systeminfo to kernel-exploit candidacy, net localgroup to group-attack pages. Run all of these before reaching for winPEAS or Seatbelt.
# Identity and privilegeswhoami # who am Iwhoami /priv # what tokens do I holdwhoami /groups # what groups grant me what
# System identity and patch levelsysteminfo # OS version, build, hotfixeswmic qfe # alternative hotfix viewGet-HotFix # PowerShell hotfix view
# Software footprintwmic product get name,version # installed products (MSI)Get-WmiObject -Class Win32_Product | Select Name, Versiontasklist /svc # running processes + servicesnetstat -ano # open ports + PIDs
# User and group inventorynet user # local usersnet localgroup # local groupsnet localgroup administrators # local admin membersnet accounts # local password policyquery user # logged-in users
# Environmentset # env vars (PATH, HOMEDRIVE, etc.)Success indicator: you can describe the host’s OS version, missing patches, your privileges, the local admin set, and which programs are installed in under five minutes.
Identity and privileges
Section titled “Identity and privileges”The three-line baseline. Always start here.
whoami - who am I
Section titled “whoami - who am I”C:\> whoamiwinlpe-srv01\htb-studentReads as MACHINENAME\username (local account) or DOMAIN\username (domain account). The presence of a domain in the output indicates this host is domain-joined and the current session has domain context - important for credential reuse and lateral-movement planning.
For SYSTEM, whoami returns nt authority\system. For local service accounts you might see nt service\mssqlserver, nt service\<servicename>, or similar.
whoami /priv - what tokens
Section titled “whoami /priv - what tokens”C:\> whoami /priv
PRIVILEGES INFORMATION----------------------
Privilege Name Description State============================= ============================== ========SeChangeNotifyPrivilege Bypass traverse checking EnabledSeIncreaseWorkingSetPrivilege Increase a process working set DisabledThis is the most operationally important command in Windows privilege escalation. Each line is a privilege. The State field is either Enabled (privilege active right now) or Disabled (privilege held but not active - most can be enabled programmatically; see the individual privilege pages for the technique).
Privileges that directly enable escalation - if any of these appear, regardless of State, jump to the linked page:
| Privilege | What it enables | See |
|---|---|---|
SeImpersonatePrivilege | Impersonate authentication tokens | SeImpersonate |
SeAssignPrimaryTokenPrivilege | Set primary token on processes | SeImpersonate |
SeDebugPrivilege | Read/write any process memory | SeDebugPrivilege |
SeTakeOwnershipPrivilege | Take ownership of any object | SeTakeOwnership |
SeBackupPrivilege | Read any file (backup semantics) | Backup Operators |
SeRestorePrivilege | Write any file (restore semantics) | Backup Operators |
SeLoadDriverPrivilege | Load kernel drivers | Other privileged groups |
A service account context with SeImpersonatePrivilege enabled - common after web shell upload to IIS or RCE through MSSQL - is the canonical “potato-family” win. Service-account-to-SYSTEM is sometimes a single command away.
Privileges that don’t directly escalate but indicate elevated context - SeSecurityPrivilege, SeSystemEnvironmentPrivilege, SeIncreaseQuotaPrivilege and others appear for local administrator contexts. If you see them while non-admin, something is misconfigured.
If whoami /priv from a non-elevated cmd shows only the default two privileges (SeChangeNotifyPrivilege, SeIncreaseWorkingSetPrivilege), you’re an unprivileged user with no obvious token-level wins. Proceed to group membership and software enumeration.
whoami /groups - what groups
Section titled “whoami /groups - what groups”C:\> whoami /groups
GROUP INFORMATION-----------------
Group Name Type SID Attributes====================================== ================ ============ ==================================================Everyone Well-known group S-1-1-0 Mandatory group, Enabled by default, Enabled groupBUILTIN\Remote Desktop Users Alias S-1-5-32-555 Mandatory group, Enabled by default, Enabled groupBUILTIN\Users Alias S-1-5-32-545 Mandatory group, Enabled by default, Enabled groupNT AUTHORITY\Authenticated Users Well-known group S-1-5-11 Mandatory group, Enabled by default, Enabled groupMandatory Label\Medium Mandatory Level Label S-1-16-8192Standard membership for a normal user: Everyone, BUILTIN\Users, NT AUTHORITY\Authenticated Users, plus mandatory integrity level.
Privileged group memberships that map to escalation paths - these are the ones to look for:
| Group | Attack page |
|---|---|
BUILTIN\Administrators | Already local admin - focus on SYSTEM via UAC bypass or service abuse |
BUILTIN\Backup Operators | Backup Operators |
BUILTIN\Event Log Readers | Other privileged groups |
BUILTIN\DnsAdmins / DOMAIN\DnsAdmins | DnsAdmins |
BUILTIN\Hyper-V Administrators | Other privileged groups |
BUILTIN\Print Operators | Other privileged groups |
BUILTIN\Server Operators | Other privileged groups |
BUILTIN\Account Operators | Can modify most non-protected users/groups |
BUILTIN\Schema Admins (AD) | Can modify AD schema - broad lateral implications |
BUILTIN\Group Policy Creator Owners | Can create GPOs (needs link delegation to apply them) |
Mandatory Integrity Level is shown at the bottom - Low, Medium, Medium Plus, High, System. A standard user runs at Medium. UAC-elevated processes run at High. SYSTEM processes run at System. Some operations require a minimum integrity level regardless of privileges.
System identity and patch level
Section titled “System identity and patch level”systeminfo
Section titled “systeminfo”C:\> systeminfoThe output is verbose; the operationally important fields:
- OS Name + OS Version + OS Build Type - Identifies the operating system.
Microsoft Windows Server 2016 Standard / 10.0.14393 N/A Build 14393maps to a specific patch baseline. The build number is the precise identifier; cross-reference against Windows release history. - System Boot Time - How long the host has been up. A boot time three weeks ago + no recent hotfixes = unpatched live system.
- Hotfix(s) - KBs applied. Critical for kernel-exploit candidacy. Cross-reference the KB list against WES-NG or Watson to find missing patches.
- Domain -
WORKGROUPmeans standalone; otherwise the AD domain name. Tells you whether AD-context attacks are in play. - Logon Server - The DC that authenticated this session.
- System Manufacturer + System Model -
VMware, Inc.orMicrosoft Corporation(Hyper-V) confirms virtualization. Bare metal indicates a physical workstation/server. - System Locale + Time Zone - Useful context for where in the world this host lives, particularly for engagement timing.
Hotfix enumeration
Section titled “Hotfix enumeration”If systeminfo doesn’t print hotfixes (some configurations hide them), query directly:
C:\> wmic qfe
Caption CSName Description HotFixID InstallDate InstalledBy InstalledOnhttp://support.microsoft.com/?kbid=3199986 WINLPE-SRV01 Update KB3199986 NT AUTHORITY\SYSTEM 11/21/2016https://support.microsoft.com/help/5001078 WINLPE-SRV01 Security Update KB5001078 NT AUTHORITY\SYSTEM 3/25/2021http://support.microsoft.com/?kbid=4103723 WINLPE-SRV01 Security Update KB4103723 NT AUTHORITY\SYSTEM 3/25/2021Or with PowerShell:
PS> Get-HotFix | ft -AutoSize
Source Description HotFixID InstalledBy InstalledOn------ ----------- -------- ----------- -----------WINLPE-SRV01 Update KB3199986 NT AUTHORITY\SYSTEM 11/21/2016 12:00:00 AMWINLPE-SRV01 Update KB4054590 WINLPE-SRV01\Administrator 3/30/2021 12:00:00 AMWINLPE-SRV01 Security Update KB5001078 NT AUTHORITY\SYSTEM 3/25/2021 12:00:00 AMSave the systeminfo output to a file and feed it to WES-NG on the attacker side:
$ python3 wes.py systeminfo.txtThis returns a list of likely-missing patches with associated CVEs and links to public exploits. The output volume can be large; filter for what’s actually exploitable in your context (kernel privilege-escalation primarily - bypass denial-of-service and RCE entries for local-context escalation).
When patches are old - what to look for
Section titled “When patches are old - what to look for”Patch dates more than 6-12 months stale are the strongest signal of kernel-exploit candidacy. Specific dates and what they imply:
| Last hotfix before | Likely vulnerable to |
|---|---|
| March 2017 | EternalBlue (MS17-010) |
| April 2018 | DoublePulsar, SambaCry |
| Sept 2018 | ALPC Task Scheduler 0-day |
| Sept 2019 | CVE-2019-1322 (UsoSvc weak ACL window - already patched) |
| June 2021 | PrintNightmare (CVE-2021-1675 / CVE-2021-34527) |
| July 2021 | HiveNightmare / SeriousSam (CVE-2021-36934) |
Match the boot-time-versus-patch-date gap. A host last patched in 2019 booted yesterday is missing two years of fixes; expect kernel exploits to land.
Software footprint
Section titled “Software footprint”Knowing what’s installed tells you both the legitimate attack surface (vulnerable third-party services) and the operator’s available tooling (PowerShell version, .NET version, etc.).
Installed products
Section titled “Installed products”C:\> wmic product get name,version
Name VersionMicrosoft Visual C++ 2019 X64 Additional Runtime 14.24.28127Java 8 Update 231 (64-bit) 8.0.2310.11VMware ToolsMicrosoft Visual C++ 2019 X64 Minimum Runtime 14.24.28127SQL Server 2016 Database Engine Services 13.2.5026.0Or with PowerShell (which is slow on large software sets - wmic is faster for first-pass):
PS> Get-WmiObject -Class Win32_Product | Select Name, Versionwmic product enumerates only MSI-installed software. Programs installed via other means (manual extracts to Program Files, portable apps in AppData, sideloaded DLLs) may not appear. For a more complete view, check the registry directly:
PS> Get-ItemProperty 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' | Select DisplayName, DisplayVersionPS> Get-ItemProperty 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' | Select DisplayName, DisplayVersionThe second path (Wow6432Node) catches 32-bit installations on 64-bit Windows.
What to look for in installed software:
- Vulnerable third-party services - search each product+version against known CVEs. Druva inSync, Splunk Universal Forwarder, various VPN clients (Windscribe, NordVPN), PCProtect, and dozens of other consumer/enterprise products have shipped weak service ACLs over the years.
- Password manager presence - KeePass, 1Password, LastPass installations indicate password databases worth hunting later.
- Backup software - Veeam, Acronis, Restic, etc. Backups often contain NTDS.dit, SAM/SYSTEM hives, or sensitive config files.
- Old runtime versions - Java 8u231 indicates the host hasn’t been updated; Java has dozens of known privilege-escalation vectors in versions of that era.
- Development tools - Visual Studio, JDKs, Python, Node.js - useful for compiling exploits locally and indicate this is a developer workstation.
Running processes
Section titled “Running processes”C:\> tasklist /svcOutput columns: Image Name, PID, Services. The “Services” column maps process PIDs to the Windows services they host, which is useful because svchost.exe hosts dozens of services - knowing which services are in which svchost lets you target service-specific abuse.
Look for:
- Non-standard services - Anything not in the Windows default set. Third-party services running as
LocalSystemor service accounts are often abuse-worthy. - Outdated services - Old versions of FileZilla, FTP servers, web frameworks, message brokers, etc. Cross-reference versions against CVE databases.
- AV/EDR - As covered in Situational awareness, processes like
MsMpEng.exe(Defender),CSFalconService.exe(CrowdStrike), etc.
Cross-reference with port listeners via netstat -ano - PIDs match between the two outputs.
Open ports
Section titled “Open ports”C:\> netstat -ano | findstr LISTENINGThe PID column ties listeners back to processes. Key things to look for:
- Localhost-only services (
127.0.0.1:port) - typically unauthenticated admin interfaces - Non-standard ports that don’t correspond to obvious services
- Services bound to specific interfaces rather than
0.0.0.0- sometimes indicates intentional segmentation - Established connections - what this host is talking to
The netstat -ano filter pattern 127.0.0.1: or [::1]: quickly reveals localhost-only listeners:
PS> netstat -ano | Select-String '127\.0\.0\.1:|\[::1\]:'User and group inventory
Section titled “User and group inventory”Local users
Section titled “Local users”C:\> net user
User accounts for \\WINLPE-SRV01
-------------------------------------------------------------------------------Administrator DefaultAccount Guesthelpdesk htb-student jordansarah secsvcReads for:
- Non-default accounts - Anything besides Administrator, DefaultAccount, Guest, and WDAGUtilityAccount. The presence of
helpdesk,jordan,sarah,secsvcsuggests this is a real workstation with a history of users. - Service-account-style names -
secsvc,backupsvc,sql_svc,iis_svc. These often have elevated rights and may be reused across systems (the “common service account password” pattern). - Admin-style names - Names with
_adm,adm_,admin_suggixes/prefixes are operator-assigned admin alter-egos.
Get details for a specific account:
C:\> net user secsvc
User name secsvcFull NameComment Network scanner - do not change password ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ High-signal - comment field sometimes leaks infoAccount active YesAccount expires NeverPassword last set ...The Comment field is sometimes used by admins to document service account purpose; in low-discipline environments it occasionally contains the password itself. Worth checking on every account.
Local groups
Section titled “Local groups”C:\> net localgroupOutput enumerates all local groups. The groups that matter from an escalation perspective are the ones listed in whoami /groups - but it’s worth knowing all groups exist on the host because some may be domain-pushed and indicate the host’s purpose.
Get group membership:
C:\> net localgroup administrators
Alias name administratorsComment Administrators have complete and unrestricted access to the computer/domain
Members
-------------------------------------------------------------------------------AdministratorhelpdesksarahsecsvcThe members of administrators are your immediate-promotion targets if you can capture their credentials. Domain accounts here (e.g., INLANEFREIGHT\jordan_adm) indicate a domain user with local admin rights - useful for lateral movement to other domain hosts.
Repeat for any operationally interesting group (net localgroup "Backup Operators", net localgroup "Server Operators", etc.).
Password policy
Section titled “Password policy”C:\> net accounts
Force user logoff how long after time expires?: NeverMinimum password age (days): 0Maximum password age (days): 42Minimum password length: 0Length of password history maintained: NoneLockout threshold: NeverLockout duration (minutes): 30Lockout observation window (minutes): 30Computer role: SERVERRead for:
- Lockout threshold -
Nevermeans no lockout. Password spraying is unconstrained. Any positive integer caps spraying attempts before account lockout (typically 3, 5, or 10). - Minimum password length - Low values indicate weak password constraints exist.
- Password complexity - Not shown in
net accounts; checksecpol.mscif GUI access exists, or query Group Policy.
Logged-in users
Section titled “Logged-in users”C:\> query user
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME>administrator rdp-tcp#2 1 Active . 3/25/2021 9:27 AM> marks the current session. Other sessions belong to other logged-in users.
Why this matters:
- Concurrent admin sessions - If a domain admin is logged in alongside you, their tokens are in process memory. Privilege escalation to SYSTEM lets you steal their token (token impersonation) or extract their credentials from LSASS.
- Avoiding detection - If a user is actively logged in, loud actions (creating users, defacing things, popping consoles) are more likely to be noticed. Plan accordingly.
Environment
Section titled “Environment”C:\> setThis dumps all environment variables. Read for:
- PATH - Order matters. Windows searches the current working directory first, then each PATH directory left-to-right. A writable directory early in the PATH (especially anything left of
C:\Windows\System32) is a DLL-injection or binary-substitution opportunity. TheWindowsAppsentry inside the user profile is a textbook example. - PATHEXT - Which extensions Windows treats as executable. Standard is
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC. Additions like.PYor.PLindicate scripting languages with shebang-style execution. - PSModulePath - Where PowerShell looks for modules. A writable directory here lets you ship malicious modules to autoload.
- TEMP / TMP - Per-user temp directory. Writable, often missed by file monitors.
- HOMEDRIVE / HOMEPATH - Sometimes maps to a network share. The presence of
H:mapped to\\server\users$\usernameindicates roaming profiles; navigating to that share may reveal other users’ folders if ACLs are loose. - LOGONSERVER - Same data as in
systeminfo, confirms which DC handled auth. - USERDNSDOMAIN / USERDOMAIN - Confirms domain context.
- USERPROFILE - Your home directory. Always check
Desktop,Documents,Downloads,AppData\Local, andAppData\Roamingfor credential files (covered in later rounds).
A common operator-targeted thing: any non-standard entries in PATH. If you see C:\CustomApps\bin\ left of C:\Windows\System32, the CustomApps\bin\ directory is high-priority - if writable, you can shadow standard Windows binaries by dropping a same-named binary there.
Putting it together
Section titled “Putting it together”A typical first-five-minutes session on a new shell:
whoami && whoami /priv && whoami /groupssysteminfonet user && net localgroup administrators && net accountstasklist /svcnetstat -ano | findstr LISTENINGsetquery userSave the output to a file (> enum.txt) for offline review. Feed systeminfo output to WES-NG on the attacker side. Cross-reference tasklist /svc against AV/EDR indicator lists.
From the data this produces, the decision tree is:
- Did
whoami /privshow a token privilege from the escalation list? → Jump to that privilege’s page. - Did
whoami /groupsshow a privileged group from the escalation list? → Jump to that group’s page. - Are missing patches old enough to suggest kernel-exploit candidacy? → Run WES-NG, pick the best match.
- Is there interesting installed software with known vulnerabilities? → Search for that product+version.
- None of the above? → Run winPEAS or Seatbelt for misconfiguration sweep, then proceed to credential hunting.
Quick reference
Section titled “Quick reference”| Task | Command |
|---|---|
| Current user | whoami |
| Current user privileges | whoami /priv |
| Current user group membership | whoami /groups |
| OS version + hotfixes (verbose) | systeminfo |
| Hotfix list (compact) | wmic qfe / Get-HotFix |
| Installed MSI products | wmic product get name,version |
| Installed apps via registry | Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select DisplayName,DisplayVersion |
| Process + service mapping | tasklist /svc |
| Listening ports + PIDs | netstat -ano | findstr LISTENING |
| Local users | net user |
| Specific user details | net user USERNAME |
| Local groups | net localgroup |
| Local admin members | net localgroup administrators |
| Password policy | net accounts |
| Currently logged-in users | query user |
| Environment variables | set |
| Saved hotfix → exploit match | wes.py systeminfo.txt (on attacker host) |
| Local exploit suggester (Meterpreter) | post/multi/recon/local_exploit_suggester |
Once enumeration data is captured, follow the decision tree above. Token-privilege wins are usually the fastest; see SeImpersonate, SeDebugPrivilege, SeTakeOwnership, Backup Operators. For group-membership wins, see DnsAdmins and Other privileged groups. The IPC-channel angle is covered in Named pipes.
Next move
Section titled “Next move”whoami /privshows SeImpersonate / SeAssignPrimaryToken → SeImpersonate → SYSTEM via potato (fastest win on service-account contexts)whoami /privshows SeDebugPrivilege → SeDebugPrivilege → LSASS dump for domain hasheswhoami /privshows SeBackupPrivilege or SeRestorePrivilege → Backup Operators flow - even off a DC, you can read protected fileswhoami /privshows SeTakeOwnership → SeTakeOwnership for service-binary overwrite- In Backup Operators / DnsAdmins / Server Operators / Print Operators / Hyper-V Admins / Event Log Readers → Other privileged groups
systeminfoshows old patch level (no 2020+ hotfixes) → kernel exploit candidate; check Watson / Sherlock / WindowsExploitSuggester output against the patch list- Service running as SYSTEM with writable named pipe → Named pipes for impersonation
- Nothing privileged found → look for misconfigured services (
accesschk -wuvqc *), credential files (unattend.xml, GPP cpassword, web.config), AlwaysInstallElevated, or scheduled tasks running as SYSTEM