Win Kernel Privesc

Get access to the target and gain a meterpreter session and then follow the following technique :-

#Local Privilege Escalation

# From the meterpreter session
getprivs

    Enabled Process Privileges
    ==========================
    Name
    ----
    SeChangeNotifyPrivilege
    SeIncreaseWorkingSetPrivilege

getsystem
    [-] priv_elevate_getsystem: Operation failed: 691 The following was attempted:
    [-] Named Pipe Impersonation (In Memory/Admin)
    [-] Named Pipe Impersonation (Dropper/Admin)
    [-] Token Duplication (In Memory/Admin)
    [-] Named Pipe Impersonation (RPCSS variant)
    [-] Named Pipe Impersonation (PrintSpooler variant)
    [-] Named Pipe Impersonation (EFSRPC variant - AKA EfsPotato)
# failed
  • Enumerate Windows Kernel vulnerabilities with Metasploit

Copy

  • By using a kernel exploit for this specific version of Windows O.S., the attacker is able to get a meterpreter session with elevated privileges.

#Manual Privilege Escalation

Windows-Exploit-Suggester

Copy

MS16-135

  • Search MS16-135 in the windows-kernel-exploits github repository

    • check the 41015.c C file to check if the code does what it's supposed to

    • in this case I will use the pre-build executable 41015.exe

  • Knowing that the specific Windows version is vulnerable to this particular exploit, proceed with the exploitation

Use the meterpreter access to upload the 41015.exe file to the temp directory within the Windows O.S.

Last updated