Netsh Helper DLL Persistence
Attackers may abuse the Netsh Helper DLL functionality by adding malicious DLLs to execute payloads every time the netsh utility is executed via administrators or scheduled tasks, achieving persistence.
The netsh.exe utility in Windows supports the addition of Helper DLLs to extend its functionality. An attacker can abuse this mechanism to establish persistence by adding a malicious DLL. When netsh.exe is executed, the malicious DLL is loaded and executed, allowing the attacker to run arbitrary code with the privileges of the user or process that initiated netsh.exe. This can be done by administrators or scheduled tasks, making it a stealthy and effective persistence technique. The registry key targeted by this technique is HKLM\Software\Microsoft\netsh\.
Attack Chain
- Attacker gains initial access to the target system through unspecified means.
- Attacker creates a malicious DLL to be used as a Netsh Helper DLL.
- Attacker modifies the Windows Registry to add the malicious DLL as a Netsh Helper DLL under
HKLM\Software\Microsoft\netsh\. - The system administrator or a scheduled task executes
netsh.exe. netsh.exeloads and executes the malicious DLL, granting the attacker code execution.- The malicious DLL performs its intended actions, such as establishing a reverse shell or deploying additional malware.
- The attacker maintains persistence on the system through the malicious Netsh Helper DLL.
Impact
Successful exploitation allows attackers to establish persistent access to a compromised system. This can lead to data theft, system compromise, and further malicious activities. While the risk score is low, the persistence mechanism can allow attackers to maintain a foothold for extended periods, increasing the potential for significant damage.
Recommendation
- Monitor registry modifications under the
HKLM\Software\Microsoft\netsh\path for suspicious DLL additions using the “Netsh Helper DLL Registry Modification” Sigma rule. - Enable Sysmon registry event logging to collect the necessary data for the Sigma rule.
- Investigate any alerts generated by the Sigma rule by reviewing the DLL file properties, timestamps, and related processes.
Detection coverage 2
Netsh Helper DLL Registry Modification
mediumDetects the modification of the registry to add a Netsh Helper DLL, which can be used for persistence.
Netsh Executing Loaded DLL
lowDetects netsh.exe executing with loaded DLLs that are not default Windows DLLs
Detection queries are kept inside the platform. Get full rules →