Shimming

Shimming is a technique used in driver manipulation to intercept and modify the behavior of legitimate device drivers without modifying their original code. It involves inserting additional code, known as a shim, between the operating system and the driver. Shimming can be used for both legitimate purposes, such as compatibility fixes, and malicious activities, such as bypassing security controls or injecting malicious code.

Shims act as a layer between the operating system and the driver, allowing for the interception and modification of driver calls and behaviors. Some common examples of shim-based attacks include:

  1. Function Hooking: Shims can intercept calls made to specific functions within a driver and redirect them to modified code. This enables attackers to modify the behavior of the driver, potentially bypassing security checks or injecting malicious instructions.
  2. API Redirection: Shims can redirect calls made to specific application programming interfaces (APIs) to alternative or malicious versions of those APIs. This can be used to manipulate data, capture sensitive information, or perform unauthorized actions.
  3. Kernel-Level Manipulation: Shims can operate at the kernel level, intercepting and modifying system calls and interactions between the operating system and the driver. This allows attackers to gain elevated privileges, perform unauthorized operations, or bypass security mechanisms.

Shimming attacks can be challenging to detect because they do not require modifying the original driver files. Instead, they leverage the dynamic modification capabilities provided by the shim layer. To mitigate the risks associated with shimming attacks, the following preventive measures can be implemented: