Researchers from Offensive Security have found a way to disable the protection systems provided by the latest version of Microsoft's Enhanced Mitigation Experience Toolkit (EMET).
EMET is designed to prevent software vulnerabilities from being exploited by using various mitigation technologies, including Structured Exception Handler Overwrite Protection (SEHOP), Data Execution Prevention (DEP), Heapspray Allocations, Null page allocation, Mandatory Address Space Layout Randomization (ASLR), Export Address Table Access Filtering (EAF) and Return Oriented Programming (ROP) mitigations.
Research papers such as "Bypassing EMET 4.1" and "EMET 4.1 Uncovered" detail mitigation bypass methods, but Offensive Security has focused on disarming EMET, rather than on bypassing mitigations, as this method gives an attacker the ability use generic shellcodes such as the ones generated by Metasploit. This also represents a generic way of disabling all protections, and "not having to rely on functions that are not critical to EMET when trying to defeat the MemProt ROP protection, especially when having 'Deep Hooks' enabled," the company said.
The researchers managed to disarm EMET and get a shell after finding a global variable in the .data section of the EMET.dll file. The said variable, which is located on a memory page marked with read/write permissions, acts as a switch to enable or disable all the ROP protections at runtime.
"If we manage to zero out the general switch, all the ROP mitigations implemented by EMET would be disabled. This requires an attacker to build a ROP chain that will dynamically retrieve the base address of EMET.dll and overwrite the global variable with a zero," Offensive Security wrote in a blog post.
Initially, experts only managed to get a shell by executing the exploit with a debugger attached, due to EMET's EAF checks. However, they've succeeded in getting a shell outside the debugger after disarming EAF with a method described by security researcher Piotr Bania in January 2012.
The researchers tested their findings on Windows 7, Internet Explorer 8 and EMET 4.1 update 1. Offensive Security says Microsoft appears to be aware of the attack method since the company addressed the issue in the technical preview versions of EMET 5 and later. Microsoft could not immediately be reached for comment.
The exploit code for disarming EMET has been made available by Offensive Security. The company has also published a video to demonstrate the attack which is embedded below.