Dynamic Link Libraries (DLLs) are essential components containing code and procedures for Windows programs. DLL hijacking exploits how certain Windows applications search for and load DLLs by placing malicious versions in directories that get searched before legitimate ones.
The UAC Bypass Technique
User Account Control (UAC), introduced in Windows Vista, provides security protections but includes built-in exceptions allowing trusted system DLLs to auto-elevate without prompts. Mock directories, folders with trailing spaces like "C:\Windows \System32", can be created via command line to exploit this vulnerability.
Exploitation Process (4 Steps)
- Malicious DLL Creation, Using msfvenom to generate CSharp shellcode for reverse shell connections
- Mock folder setup, Creating directories and copying legitimate binaries alongside malicious DLLs
- Administrative shell acquisition, Executing computerdefaults.exe to load the hijacked DLL (propsys.dll)
- Post-exploitation, Credential dumping with Mimikatz, lateral movement
Why This Works
computerdefaults.exe is a trusted Windows binary that auto-elevates without UAC prompts. When placed in a mock directory, Windows Defender treats the execution context as trusted, allowing the malicious DLL to load without generating alerts.
Mitigation
Set UAC to "Always Notify" to display prompts before high-risk applications execute. This prevents auto-elevation of binaries like computerdefaults.exe and blocks the attack chain at the privilege escalation stage.
Endpoint Detection and Response (EDR) solutions should monitor for DLL loading from non-standard directory paths and alert on mock directory creation (directories containing trailing spaces).
Originally published on cytomate.net
