Windows Privilege Escalation Tools
Several scripts automate system enumeration in much the same way as the manual checks seen earlier. They can shorten the enumeration process and surface privilege escalation vectors you might otherwise miss, but keep in mind that automated tools can also miss vectors.
Below are a few tools commonly used to find privilege escalation vectors. Run them against any of the machines in this room and see whether the results match the attack vectors already discussed.
WinPEAS
WinPEAS is a script that enumerates the target system to uncover privilege escalation paths. You can find more information about it and download either the precompiled executable or a .bat script. WinPEAS runs commands similar to the manual ones from the previous task and prints their output. That output can be lengthy and hard to read, so it is good practice to redirect it to a file:
C:\> winpeas.exe > outputfile.txt
WinPEAS can be downloaded here.
PrivescCheck
PrivescCheck is a PowerShell script that searches for common privilege escalation paths on the target. It is an alternative to WinPEAS that does not require running a binary.
PrivescCheck can be downloaded here.
Reminder: To run PrivescCheck on the target, you may need to bypass the execution policy restrictions. Use the Set-ExecutionPolicy cmdlet:
PS C:\> Set-ExecutionPolicy Bypass -Scope process -Force
PS C:\> . .\PrivescCheck.ps1
PS C:\> Invoke-PrivescCheck
WES-NG: Windows Exploit Suggester - Next Generation
Some suggesting scripts (winPEAS among them) require you to upload them to the target and run them there, which may trip antivirus. To avoid that noise, you may prefer WES-NG, which runs on your attacking machine (Kali or the TryHackMe AttackBox).
WES-NG is a Python script that can be found and downloaded here.
Once installed, run wes.py --update before first use to update the database. The script checks that database for missing patches that could give you a privilege escalation path on the target.
To use it, run the systeminfo command on the target and direct its output to a .txt file, then move that file to your attacking machine. From there:
user@kali$ wes.py systeminfo.txt
Metasploit
If you already have a Meterpreter shell on the target, the multi/recon/local_exploit_suggester module lists vulnerabilities that may affect the system and let you elevate your privileges.