Unsigned DLL Loaded by Svchost for Persistence and Privilege Escalation
Adversaries may load unsigned DLLs into svchost.exe to establish persistence or escalate privileges, leveraging a shared Windows service to execute malicious code with elevated permissions.
Attackers may attempt to load malicious, unsigned DLLs into svchost.exe, a legitimate Windows service host process, to maintain persistence or escalate privileges. This technique abuses the shared service host process to execute arbitrary code with SYSTEM privileges. The svchost.exe process, which typically hosts multiple Windows services, can be targeted to load malicious DLLs from unusual file paths, potentially bypassing security measures that rely on code signing validation. This is especially concerning because svchost.exe is a trusted process, making detection more challenging. The loading of unsigned DLLs by svchost.exe from atypical directories is a strong indicator of potential malicious activity, as legitimate Windows services rarely load unsigned libraries from such locations.
Attack Chain
- An adversary gains initial access to the system through an undisclosed method (e.g., exploitation of a vulnerability or social engineering).
- The attacker creates a malicious, unsigned DLL on the compromised system in a non-standard directory like
C:\ProgramData\. - The attacker modifies the Windows Registry to configure a service hosted by
svchost.exeto load the malicious DLL. This often involves manipulating service dependencies or service parameters. - The system is restarted, or the targeted service is manually restarted, causing
svchost.exeto load the specified DLL. svchost.exeexecutes the code within the malicious DLL, now running with the privileges of the hosted service (typically SYSTEM).- The malicious DLL performs actions such as installing backdoors, escalating privileges further, or establishing command and control (C2) communication.
- The attacker uses the established C2 channel to remotely control the compromised system, exfiltrate data, or perform other malicious activities.
- The attacker maintains persistence on the system by ensuring the malicious DLL is loaded each time the service or system starts.
Impact
Successful exploitation allows attackers to gain persistent access to the compromised system with elevated (SYSTEM) privileges. This can lead to complete system compromise, data theft, installation of backdoors, and lateral movement within the network. The use of svchost.exe as a host for malicious DLLs makes detection more difficult, allowing attackers to operate undetected for extended periods.
Recommendation
- Implement the provided Sigma rule to detect unsigned DLLs loaded by
svchost.exe, focusing on the specified file paths and code signature status. - Examine
dll.Ext.relative_file_creation_timeto identify DLLs created shortly before being loaded to catch newly created malicious files. - Review and validate the legitimacy of all DLLs loaded by
svchost.exe, focusing on those located in unusual paths. - Update endpoint detection and response (EDR) systems to specifically monitor for the loading of unsigned DLLs by system processes like
svchost.exe. - Continuously update the exclusion list of known good DLL hashes to reduce false positives.
Detection coverage 2
Unsigned DLL Loaded by Svchost
mediumDetects the loading of an unsigned DLL by svchost.exe from unusual paths.
Suspicious DLL Creation and Svchost Load
mediumDetects recently created DLLs loaded by svchost, indicating potential malicious DLL injection.
Detection queries are kept inside the platform. Get full rules →
Indicators of compromise
5
hash_sha256
| Type | Value |
|---|---|
| hash_sha256 | 3ed33e71641645367442e65dca6dab0d326b22b48ef9a4c2a2488e67383aa9a6 |
| hash_sha256 | b4db053f6032964df1b254ac44cb995ffaeb4f3ade09597670aba4f172cf65e4 |
| hash_sha256 | 214c75f678bc596bbe667a3b520aaaf09a0e50c364a28ac738a02f867a085eba |
| hash_sha256 | 23aa95b637a1bf6188b386c21c4e87967ede80242327c55447a5bb70d9439244 |
| hash_sha256 | 5050b025909e81ae5481db37beb807a80c52fc6dd30c8aa47c9f7841e2a31be7 |