Researchers have found yet another method for bypassing the User Account Control (UAC) security feature in Windows by leveraging a legitimate tool.
Last month, Matt Graeber and Matt Nelson disclosed a Windows 10 UAC bypass method that involved Disk Cleanup, the utility that allows users to free up space on their hard drives.
UAC, a feature introduced in Windows Vista, has been bypassed on several occasions, in most cases by copying privileged files and hijacking DLLs. The method detailed by Graeber and Nelson does not involve these operations, making it more difficult to detect.
A new method found by the experts also doesn’t leverage any code injections or privileged file copying operations. The new technique, which the researchers say can be used for a “fileless” UAC bypass, involves the Windows Registry and the Event Viewer tool.
Event Viewer, which allows Windows users to view event logs on a local or remote machine, is one of the binaries signed by Microsoft that are auto-elevated if UAC is configured with the “Notify me only when programs/apps try to make changes to my computer” settings (the two middle settings).
Researchers discovered that Event Viewer (eventvwr.exe) queries a couple of registry keys in the HKEY_CLASSES_ROOT (HKCR) and HKEY_CURRENT_USER (HKCU) hives. The goal is to load the Microsoft Management Console (mmc.exe), which is used to load saved console files (.msc).
When Event Viewer queries the HKCU registry key, a “NAME NOT FOUND” value is returned, after which the process queries the HKCR key. Graeber and Nelson created the registry structure necessary for successfully querying the HKCU location and replaced an executable file included in the key’s default value with powershell.exe. This can allow attackers to use PowerShell to execute arbitrary scripts and commands on the targeted system.
“This means that code execution has been achieved in a high integrity process (bypassing UAC) without dropping a DLL or other file down to the file system. This significantly reduces the risk to the attacker because they aren’t placing a traditional file on the file system that can be caught by AV/HIPS or forensically identified later,” Nelson explained in a blog post.
The researchers have published a proof-of-concept (PoC) exploit that creates the required registry entry in HKCU, executes a PowerShell command, and then cleans up the registry. The attack technique has been successfully tested on Windows 7 and 10, but the experts believe it works on all versions of the operating system that have UAC.
Microsoft considers these methods a bypass of a defense-in-depth feature and not vulnerabilities. The company pointed out that the attacks require administrative privileges to work.
Users can protect themselves against these types of attacks by configuring the UAC level to “Always Notify” and avoid using accounts with administrative privileges for regular tasks.