Cybersecurity firm ESET discovered a Windows zero-day exploit that affects older systems like Windows 7 and Server 2008. Called CVE-2019-1132, it is a privilege escalation issue linked to how the Win32k tool handles objects in memory. The upshot of all of this is that it can be exploited in order to execute arbitrary code in kernel mode.
ESET published a blog about the problem.
ESET first saw the attack in June when it was used in an attack of a government institution in eastern Europe. The attack was attributed by ESET to the Buhtrap group of threat actors, who are thought to be Russian in origin and had previously been active in financial crimes since 2014.
The exploit creates two windows. For the first window, it creates popup menu objects and appends menu items using the CreatePopupMenu and AppendMenu functions. In addition, the exploit sets up WH_CALLWNDPROC and EVENT_SYSTEM_MENUPOPUPSTART hooks.
The exploit then displays a menu using the TrackPopupMenu function. The exploit needs to catch the moment in time when the initial menu is already created, but the sub-menu is going to be created. For that, the exploit has code that handles the WM_NCCREATE message in the WH_CALLWNDPROC hook. When the exploit code detects the system is in this state, it sends a MN_CANCELMENUS (0x1E6) message to the first menu, which cancels that menu. However, its sub-menu is still about to be created.
Now, the attackers use the second window to continue the process. The main exploit goal is to flip the bServerSideWindowProc bit in the tagWND structure of the second window. The exploit can then send a specific message to the second window in order to execute WndProc in kernel mode.
As a final step, the exploit will replace the token of the current process with the system token.
ESET notes that, “The exploit only works against older versions of Windows, because since Windows 8 a user process is not allowed to map the NULL page. Microsoft back-ported this mitigation to Windows 7 for x64-based systems.”
ESET reported the situation to Microsoft, which issued a patch for it in the July 2019 Patch Tuesday updates. Legacy, unmatched systems will be vulnerable to the exploit. Upgrading to a newer OS will eliminate this particular vulnerability.
— Larry Loeb has written for many of the last century's major "dead tree" computer magazines, having been, among other things, a consulting editor for BYTE magazine and senior editor for the launch of WebWeek.