Local Windows Privilege Escalation

OS

Get architecture & patches

systeminfo
wmic qfe

Get Environment Variables

set
Get-ChildItem Env: | ft Key,Value

Get Connected Drives

net use
wmic logicaldisk get caption,description,providername
Get-PSDrive | where {$_.Provider -like "Microsoft.PowerShell.Core\FileSystem"}| ft Name,Root

Users

Any interesting user privileges? Note: The State column does not mean that the user does or does not have access to this privilege. If the privilege is listed, then that user has it.

whoami /priv

What users are on the system? Any old user profiles that weren’t cleaned up?

net users
dir /b /ad "C:\Users\"
dir /b /ad "C:\Documents and Settings\" # Windows XP and below

Is anyone else logged in?

What local groups are on the system?

Check Admnistrators Group users

Anything in the Registry for User Autologon?

Anything interesting in Credential Manager?

Can we access SAM and SYSTEM files?

Programs, Processes, and Services

What software is installed?

Full Permissions for Everyone or Users on Program Folders?

Modify Permissions for Everyone or Users on Program Folders?

You can also upload accesschk from Sysinternals to check for writeable folders and files. https://live.sysinternals.com/

What are the running processes/services on the system? Is there an inside service not exposed? If so, can we open it?

Get-Process has a -IncludeUserName option to see the process owner, however you have to have administrative rights to use it.

This one liner returns the process owner without admin rights, if something is blank under owner it’s probably running as SYSTEM, NETWORK SERVICE, or LOCAL SERVICE.

Any weak service permissions? Can we reconfigure anything? Again, upload accesschk.

Are there any unquoted service paths?

What scheduled tasks are there? Anything custom implemented?

What is ran at startup?

Is AlwaysInstallElevated enabled? I have not ran across this but it doesn’t hurt to check.

Networking

What NICs are connected? Are there multiple networks?

Anything in the ARP cache?

Are there connections to other hosts?

Anything in the hosts file?

Is the firewall turned on? If so what’s configured?

Any other interesting interface configurations?

Are there any SNMP configurations?

Interesting Files and Sensitive Information

Any passwords in the registry?

Are there sysprep or unattend files available that weren’t cleaned up?

If the server is an IIS webserver, what’s in inetpub? Any hidden directories? web.config files?

What’s in the IIS Logs?

Is XAMPP, Apache, or PHP installed? Any there any XAMPP, Apache, or PHP configuration files?

Any Apache web logs?

Any interesting files to look at? Possibly inside User directories (Desktop, Documents, etc)?

Files containing password inside them?

Techniques

Transferring Files

PowerShell Cmdlet

PowerShell One-Liner

PowerShell One-Line Script Execution in Memory

PowerShell with Proxy

PowerShell Script

Non-interactive FTP via text file. Useful for when you only have limited command execution.

CertUtil

Certutil can also be used for base64 encoding/decoding.

CURL

And with PowerShell

Port Forwarding

For example to expose SMB, on the target run:

SSH enabled in Win10 1803 by default

Port Forwarding

Resources

  • https://www.absolomb.com/2018-01-26-Windows-Privilege-Escalation-Guide/

  • https://live.sysinternals.com/

  • https://github.com/absolomb/WindowsEnum

Last updated

Was this helpful?