Skip to main content

Overview

The Process DLL Hijack check identifies DLL files loaded by running processes that have weak file permissions. If a DLL used by a privileged process can be modified, an attacker can inject malicious code that executes with the process’s privileges.
This check excludes known DLLs (registered in the KnownDLLs registry key) and system32 DLLs which are typically protected.

How It Works

SharpUp performs the following:
  1. Reads known DLLs from HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDlls
  2. Enumerates all running processes
  3. For each process, enumerates loaded DLL modules
  4. Excludes DLLs in C:\Windows directory
  5. Excludes KnownDLLs
  6. Checks if remaining DLLs are writable
  7. Reports hijackable DLLs with associated process information

Example Output

Exploitation

Method 1: Direct DLL Replacement

Method 2: DLL Proxying

Remediation

1

Identify Writable DLLs

2

Fix DLL Permissions

Detection

Defensive Monitoring

Hijackable Paths

Writable folders in system PATH

Modifiable Service Binaries

Service executables with weak permissions