Proper enumeration is the foundation of successful privilege escalation on Windows systems. This document outlines key areas to examine and commands to use when enumerating a Windows machine.
System Information
# Basic system informationsysteminfosysteminfo | findstr /B /C:"OS Name"/C:"OS Version"/C:"System Type"# Hotfixes and patcheswmic qfe get Caption,Description,HotFixID,InstalledOn# Environment variablessetGet-ChildItem Env: |Format-Table-AutoSize# Connected driveswmic logicaldisk get caption,description,providernameGet-PSDrive|Where-Object{$_.Provider-like"Microsoft.PowerShell.Core\FileSystem"}# Network informationipconfig /allroute printarp -a
User Information
Network Information
Running Processes and Services
Scheduled Tasks
File System Information
Registry Settings
Installed Applications
Antivirus and Security Products
Interesting Directories and Files
Automated Enumeration Tools
For more thorough enumeration, consider using specialized tools if you can upload them to the target system:
Combining PowerShell Commands
Create custom PowerShell scripts to perform multiple checks:
Remember
Always check what commands are available and usable in your specific context.
Take notes of findings for later analysis.
Look for unusual or non-standard configurations.
Correlate information between different sources to identify privilege escalation vectors.
Be methodical and thorough in your enumeration process.
This enumeration process will help identify potential privilege escalation vectors. After completing enumeration, analyze your findings to determine the most promising attack paths.
Identifying Suspicious Processes
Analyzing running processes is critical for identifying potential security issues or opportunities for privilege escalation. Non-standard processes can indicate compromise or misconfigurations that you can exploit.
Listing and Analyzing Processes
Suspicious Process Characteristics
When analyzing processes, look for:
Unusual locations: Processes running from temp directories, user directories, or non-standard program paths
Uncommon names: Processes with misspelled names (e.g., svch0st.exe instead of svchost.exe)
High privileges: Processes running as SYSTEM or Administrator unnecessarily
Missing descriptions: Legitimate Windows processes typically have proper descriptions
Unusual parent-child relationships: Use Process Explorer to identify abnormal process hierarchies
Suspicious Process Examples
These processes might indicate potential compromise or misconfiguration:
seatbelt.exe: Part of the GhostPack toolkit, used for security assessments; presence may indicate ongoing penetration testing or compromise
nc.exe/netcat: Network utility commonly used for creating backdoors or reverse shells
psexec.exe: Legitimate SysInternals tool, but often abused for lateral movement
mimikatz.exe: Credential dumping tool
powershell.exe with unusual parent processes or command line parameters
cmd.exe running as SYSTEM or with unusual parent processes
wmic.exe used for remote execution or suspicious queries
Detailed Analysis with Seatbelt
Ironically, Seatbelt itself is a powerful enumeration tool used by penetration testers. If you find it installed, you might be able to use it for your own enumeration:
Process Analysis with PowerShell
Investigating Process Command Lines
Command line parameters can reveal suspicious behavior:
Exploiting Weak Process Permissions
If you find a process running with high privileges but with weak file permissions:
# Current user
whoami
whoami /all
# Local users
net user
Get-LocalUser | Format-Table Name,Enabled,LastLogon
# Local administrators
net localgroup administrators
Get-LocalGroupMember -Group "Administrators" | Format-Table Name,PrincipalSource
# User privileges
whoami /priv
# Open ports and connections
netstat -ano
Get-NetTCPConnection | Where-Object { $_.State -eq "Listen" } | Format-Table LocalAddress,LocalPort,RemoteAddress,RemotePort,State
# Firewall configuration
netsh firewall show state
netsh firewall show config
netsh advfirewall firewall show rule name=all
# Network shares
net share
Get-SmbShare
# List running processes
tasklist /v
Get-Process | Format-Table Name,Id,Path,Company
# List services
net start
wmic service list brief
Get-Service | Where-Object {$_.Status -eq "Running"} | Format-Table -Property Name,DisplayName,Status
# Query specific service
sc qc <service_name>
Get-Service <service_name> | Select-Object *
# List scheduled tasks
schtasks /query /fo LIST /v
Get-ScheduledTask | Where-Object {$_.State -ne "Disabled"} | Format-Table TaskName,TaskPath,State
# Check Windows Defender status
Get-MpComputerStatus
# Check for common security products
wmic /namespace:\\root\securitycenter2 path antivirusproduct GET displayName,productState,pathToSignedProductExe
# Search for common sensitive files
Get-ChildItem -Path C:\ -Include *pass*.txt,*pass*.xml,*pass*.ini,*pass*.xlsx,*cred*,*vnc*,*.config*,*.conf,*id_rsa*,*.key -File -Recurse -ErrorAction SilentlyContinue
# Search for web configuration files
Get-ChildItem -Path C:\ -Include web.config,applicationHost.config,php.ini,httpd.conf,httpd-xampp.conf,my.ini,my.cnf -File -Recurse -ErrorAction SilentlyContinue
# Search for recent files
Get-ChildItem -Path C:\Users -Recurse -File | Sort-Object LastWriteTime -Descending | Select-Object FullName,LastWriteTime -First 50
# Windows Privilege Escalation Awesome Script (WinPEAS)
.\winPEAS.exe
# PowerUp (Privilege escalation checks)
Import-Module .\PowerUp.ps1
Invoke-AllChecks
# SharpUp (C# port of PowerUp)
.\SharpUp.exe
# PrivescCheck
Import-Module .\PrivescCheck.ps1
Invoke-PrivescCheck
$ErrorActionPreference = "SilentlyContinue"
# System info
Write-Host "[+] System Information" -ForegroundColor Green
systeminfo | Select-String "OS Name", "OS Version", "System Type"
# User information
Write-Host "[+] Current User and Privileges" -ForegroundColor Green
whoami /all
# Service information
Write-Host "[+] Non-standard Services" -ForegroundColor Green
Get-WmiObject win32_service | Where-Object {$_.PathName -notmatch "C:\\Windows"} | Select-Object Name, PathName, StartMode
# Scheduled tasks
Write-Host "[+] Interesting Scheduled Tasks" -ForegroundColor Green
Get-ScheduledTask | Where-Object {$_.TaskPath -notmatch "\\Microsoft\\"} | Format-Table TaskName,TaskPath,State
# Network information
Write-Host "[+] Network Connections" -ForegroundColor Green
netstat -ano | findstr "LISTENING"
# Basic process listing
tasklist
# Verbose process listing
tasklist /v
# List processes with service information
tasklist /svc
# More detailed process information with PowerShell
Get-Process | Select-Object Name, Id, Path, Company
# Find processes running as SYSTEM
tasklist /v | findstr "SYSTEM"
# Find processes with unusual paths
wmic process get name,executablepath | findstr /i /v "C:\\Windows\\system32"
# If available, run basic checks
Seatbelt.exe -group=system
# Run all checks
Seatbelt.exe all
# Specific checks for processes
Seatbelt.exe NonstandardProcesses
# Using wmic (works on older Windows versions)
wmic process get name,commandline
# Using PowerShell (more modern)
Get-WmiObject Win32_Process | Select-Object Name, CommandLine
# Look for suspicious flags in PowerShell commands
Get-WmiObject Win32_Process | Where-Object {$_.CommandLine -like "*-enc*" -or $_.CommandLine -like "*-exec*bypass*"} | Select-Object Name, CommandLine
# Check file permissions of the executable
icacls "C:\path\to\suspicious\process.exe"
# If writable, you might be able to replace it with a malicious version
copy C:\path\to\malicious.exe C:\path\to\suspicious\process.exe
# Or if service, check service configuration
sc qc "SuspiciousService"
# List services
net start
wmic service list brief
Get-Service | Where-Object {$_.Status -eq "Running"} | Format-Table -Property Name,DisplayName,Status
# Query specific service
sc qc <service_name>
Get-Service <service_name> | Select-Object *