Attacking the OS

User Account Control

Checking Current User

C:\> whoami /user

USER INFORMATION
----------------

User Name         SID
================= ==============================================
winlpe-ws03\sarah S-1-5-21-3159276091-2191180989-3781274054-1002

Confirming Admin Group Membership

C:\> net localgroup administrators

Alias name     administrators
Comment        Administrators have complete and unrestricted access to the computer/domain

Members

-------------------------------------------------------------------------------
Administrator
mrb3n
sarah
The command completed successfully.

Reviewing User Privileges

Confirming UAC is Enabled

Checking UAC Level

Checking Windows Version

Reviewing Path Variable

Generating Malicious srrstr.dll DLL

Starting Python HTTP Server on Attack Host

Downloading DLL Target

Starting nc Listener on Attack Host

Testing Connection

Executing SystemPropertiesAdvanced.exe on Target Host

Receiving Connection Back

Weak Permissions

Permissive File System ACLs

Running SharpUp

Checking Permissions with icacls

Replacing Service Binary

Weak Service Permissions

Reviewing SharpUp Again

Checking Permissions with AccessChk

Check Local Admin Group

Changing the Service Binary Path

Stopping Service

Starting the Service

Confirming Local Admin Group Addition

Weak Service Permissions - Cleanup

Reverting the Binary Path

Starting the Service Again

Verifying Service is Running

Unquoted Service Path

Service Binary Path

Querying Service

Searching for Unquoted Service Paths

Permissive Registry ACLs

Changing ImagePath with PowerShell

Modifiable Registry Autorun Binary

Check Startup Programs

Kernel Exploits

Checking Permissions on the SAM File

Performing Attack and Parsing Password Hashes

Checking for Spooler Service

Adding Local Admin with PrintNightmare PowerShell PoC

Confirming New Admin User

Enumerating Missing Patches

Examining Installed Updates

Viewing Installed Updates with WMI

CVE-2020-0668 Example

Checking Current User Privileges

After Building Solution

Checking Permissions on Binary

Generating Malicious Binary

Hosting the Malicious Binary

Downloading the Malicious Binary

Running the Exploit

Checking Permissions of New File

Replacing File with Malicious Binary

Metasploit Resource Script

Launching Metasploit with Resource Script

Starting the Service

Receiving a Meterpreter Session

Vulnerable Services

Enumerating Installed Programs

Enumerating Local Ports

Enumerating Process ID

Enumerating Running Service

Druva inSync Windows Client Local Privilege Escalation Example

Modifying PowerShell PoC

Starting a Python Web Server

Catching a SYSTEM Shell

Last updated