Essentially - manual enumeration and knowing how to privesc is key here. You have to know how to do this manually, sometimes you will be thrust into an environment where your ability to freely use tools can be quite limited.
Windows systems present a vast attack surface. Just some of the ways that we can escalate privileges are:
- Abusing Windows group privileges
- Abusing Windows user privileges
- Bypassing User Account Control
- Abusing weak service/file permissions
- Leveraging unpatched kernel exploits
- Credential theft
- Traffic Capture
- and more.
That being said, we may need to escalate privileges for one of the following reasons:
|1.|When testing a client's gold image Windows workstation and server build for flaws| |2.|To escalate privileges locally to gain access to some local resource such as a database| |3.|To gain NT AUTHORITY\System level access on a domain-joined machine to gain a foothold into the client's Active Directory environment| |4.|To obtain credentials to move laterally or escalate privileges within the client's network|
Example scenarios:
Client-provided system, no internet access and blocked usb ports.
Find network flaw in which printer VLAN config'd to allow outbound
Manual enum used to find permissions flaw to esc priv - manual dump LSASS
Mount smb share from attacker -> system - exfil LSASS
mimikatz to crack lsass
Locked-down env well monitored
Wide-open fileshare hosting backups of vms in environment
find .vmdk, vhdx files - access share from win VM,
mount .VHDX browse filesystem
retrieve SYSTEM, SAM, SECURITY registry hives - move to attack box,
extract local admin with secretsdump
gold image used - local admin hash worked on nearly every win system
Locked down network
Allowed to use tools - Run Snaffler to hunt fileshares
.sql files with creds
MSSQL client connection, enable xp_cmdshell for local cmd exec
confirm SeImpersonatePrivilege
Juicy potato used to privesc
List of useful tools for windows privilege escalation
| Tool | Description |
|---|---|
| Seatbelt | C# project for performing a wide variety of local privilege escalation checks |
| winPEAS | WinPEAS is a script that searches for possible paths to escalate privileges on Windows hosts. All of the checks are explained here |
| PowerUp | PowerShell script for finding common Windows privilege escalation vectors that rely on misconfigurations. It can also be used to exploit some of the issues found |
| SharpUp | C# version of PowerUp |
| JAWS | PowerShell script for enumerating privilege escalation vectors written in PowerShell 2.0 |
| SessionGopher | SessionGopher is a PowerShell tool that finds and decrypts saved session information for remote access tools. It extracts PuTTY, WinSCP, SuperPuTTY, FileZilla, and RDP saved session information |
| Watson | Watson is a .NET tool designed to enumerate missing KBs and suggest exploits for Privilege Escalation vulnerabilities. |
| LaZagne | Tool used for retrieving passwords stored on a local machine from web browsers, chat tools, databases, Git, email, memory dumps, PHP, sysadmin tools, wireless network configurations, internal Windows password storage mechanisms, and more |
| Windows Exploit Suggester - Next Generation | WES-NG is a tool based on the output of Windows' systeminfo utility which provides the list of vulnerabilities the OS is vulnerable to, including any exploits for these vulnerabilities. Every Windows OS between Windows XP and Windows 10, including their Windows Server counterparts, is supported |
| Sysinternals Suite | We will use several tools from Sysinternals in our enumeration including AccessChk, PipeList, and PsService |
We can also find pre-compiled binaries of Seatbelt and SharpUp here, and standalone binaries of LaZagne here. It is recommended that we always compile our tools from the source if using them in a client environment.
It is always a safe bet to upload tools to C:\Windows\Temp because the BUILTIN\Users group has write access.
Strive to learn what each tool does - if does not work as expected or if cannot be loaded, you know how to do it manually. Tools can be a double-edged sword, while they help speed up enumeration and give us highly detailed output - we could be working less efficiently if we dont know how to leverage it and read it effectively. False pos can be produced.
Do not rely on autopwn scripts/tools that cannot be controlled. Write your own tools/scripts to perform both enumeration and exploitation steps.
You should also know how to operator in an environment where these tools cannot be loaded (airgapped networks, systems no internet)
There's also risks. Performing excessive enumeration can cause system instability or issues with a system that are already known to be fragile. These tools are well known, most if not all will be detected and blocked by common antivirus - and most certainly by advanced EDR products like Cylance or Carbon black - we can use a variety of methods to get our tools past common AV products, such as removing comments, changing function names, encrypting the executable, etc.