top of page

Microsoft's most recent versions of Windows offer a feature called "Core isolation" to protect very important processes from malicious access or tampering via virtualization.

Among the available protections, we find "Hypervisor-protected Code Integrity (HVCI)", or "Memory Integrity" in the settings, which aim at preventing malicious code to leverage low level drivers and their powers.

We highly recommend the activation of this security setting .

The long explanation and how-to on enabling memory integrity are described at ref 1 and ref 2 below.


But then:

  • How to deal with non-compliant drivers that prevent the activation of the protection?

  • Better still, how to know which process/program is using the driver, so to know what you may impact on removal if you choose to do so?

Read through to find out!


Getting to work


Before we start getting rid of drivers that Windows lists as non-compliant and preventing the activation of the Memory Integrity security feature, we will first try to understand what the driver in question is and what process/service may be using it.


The goal here is to be careful and avoid letting our system in an non-functional state while trying to remove non-compliant drivers. Then we can look at removing it from a device point of view in the next section.


Which process is currently using a driver?


Now, let's pretend Windows told us that the following driver was non-compliant (insecure from the memory integrity security standpoint):

\SystemRoot\System32\drivers\vpnpbus.sys

We will refer to our article "How to investigate which Windows process currently has a file opened?" for the procedure.


By searching for the driver name ("vpnpbus.sys" in this case) in the handles search of Process Hacker, we will know instantly if a process is currently using it, and which one. This will greatly help our analysis of the impact we may cause by stopping the driver or removing it from our system.


For example, the "vpnpbus.sys" driver we searched for was indeed in use at that time, meaning a functionality of our system or devices is dependent on it:

Consequently, its stopping or removal may break a functionality, so let's be careful if we do that.


If Process hacker did not find the driver in question, it does not mean that it is not ultimately important for our system, but at least that it is not always running, so less critical in that sense.


Removing drivers from your system


Windows 10/11 store their drivers in various folders, as source or installed repository (ref 3):

\SystemRoot\INF
\SystemRoot\System32\drivers\
\SystemRoot\System32\DriverStore\FileRepository\

where "\systemroot\" would be "C:\windows" for most people.


But exactly as for programs, dont' just go and try to remove mere files, because 1) it's not gonna work since the files are protected, even with a local admin account and 2) an installed driver is more than a file and has information stored in other places (like the registry or other folders) that need to be cleaned up.


The easiest and (graphical) way to remove a driver is through the Device Manager configuration panel.


We will refer to our article "Investigate which device uses a Windows driver (device/driver relationship)" for the procedure.


Disclaimer: proceed with caution at this step since stopping or removing a driver may crash your system or prevent it from functioning properly. Understand what you are doing first.


In the Device Manager, find the problematic driver reported by Windows in the list (for example "oem6.inf") Right-click on it and choose "Remove Driver".


You will be prompted with a confirmation. We want to remove the driver for any device using it because it is the driver itself preventing the activation of the memory security feature. Try first without checking the 2nd box, to avoid crashes and instability. So confirm it is the right driver you want to remove and click "Remove".



References

We may encounter situations where Windows reports that a file is locked and prevents modification or deletion.

Our goal here is to identify which active process currently has a file opened, called a "handle" (ref 1), then act diligently to solve the issue.

The approach we take is one that supports and aligns with our overall Forensics and incident response practice, where tools are choses for global reasons that may not be apparent at first sight.


Process Hacker to the rescue

Process Hacker is an open source task manager that can be seen as the Windows task manager on steroids, and downloaded from its official page here (ref 2).

At the time of our writing, the alternative of using the renowned Sysinternals Process Explorer from Microsoft (ref 3) did not yield the expected results, especially with drivers (sensitive code at the kernel level).

Note: You can find more practical information on ways to approach the handles identification at ref 4 (external link).

Now, let's pretend that Windows tells us that the following file is locked and cannot be modified or deleted:

C:\Fullblown_Security_Services.pdf

Let's find out which process has it opened.


Steps:
  • Run the Process Hacker program downloaded from the official page above.

  • Click on the "Hacker" menu, then "Find handles or DLLs..."

  • Type some words contained in the problematic file name in the "Filter" field then hit "Find".

  • We could get a result similar to the screenshot below, where we find that Acrobat Reader DC, running as process ID 35160, is holding a handle with ID 0x50c on our file. If there are too many results, try being more specific in your search.

  • We now know that we need to close Acrobat Reader DC to solve our access issue (or kill it in instances where the program is inaccessible or non-responsive).

  • It is also then possible to right-click on the results to get more options for information and actions, like advanced properties or access the process from the processes list and act on it (inspect, kill, etc):


References

Drivers are critical software pieces that allow devices to communicate with Windows and vice-versa.


The quality of their code is of utmost importance for the performance and function of the devices themselves, but also for the security of our whole systems as they run at the Windows kernel level (more geek information at ref 1).


The easiest and (graphical) way to understand the relationship between a Windows device (either hardware or software) and its drivers is through the Windows native Device Manager configuration panel.


Windows 10 and 11 now provide (Since mid 2021) a new view in the Device Manager to do exactly that, and labeled " Devices by driver"


Disclaimer: proceed with caution at this step since stopping or removing a driver or device may crash your system or prevent it from functioning properly. Understand what you are doing first.


Steps:
  • Load the Device Manager configuration panel (various instructions at ref 2)

  • Click the "View" menu, then "Devices by driver".


  • The view will be refreshed with a new list, showing drivers by their " ***.inf " configuration file name. The drivers that are used can be expanded to show the specific devices depending on them.


  • Right-click on a driver entry (***.inf) to get options for more information or actions on the driver.


  • Right-click on a device entry (under the ***.inf) to get options for more information or actions on the driver or device.




References
1
2
bottom of page