← All posts

Netsh Helper DLL Persistence: The Networking Extension Point Attackers Load at Boot

How attackers abuse Netsh helper DLLs for stealthy persistence and privilege reuse on Windows, and how to audit the registry hive that controls them.

Most persistence hunting focuses on the usual suspects: Run keys, scheduled tasks, services, and startup folders. Netsh helper DLLs are quieter. They live in a single registry hive, they are documented and legitimately used by Windows itself, and they load into a signed Microsoft binary — netsh.exe — every time it runs. That combination makes them a favorite for operators who want a foothold that survives reboots and blends into normal administrative activity. This is MITRE ATT&CK technique T1546.007, and it is still under-monitored on most endpoints.

What Netsh helpers actually are

netsh.exe (Network Shell) is the command-line tool for configuring interfaces, firewall rules, WLAN profiles, and more. Its functionality is modular: each context (firewall, wlan, interface, ras) is provided by a helper DLL. When netsh starts, it enumerates a registry key and loads every DLL listed there into its own process.

That key is:

HKLM\SOFTWARE\Microsoft\NetSh

Each value is a name-to-DLL mapping. On a clean system you will see entries like authfwcfg.dll, dhcpcmonitor.dll, fwcfg.dll, and wcmdll.dll. The value data is often just a bare DLL name, resolved through the standard DLL search order — which is itself a second-order problem worth auditing.

Why attackers like it

What the attack looks like

Installation requires local admin (writing under HKLM\SOFTWARE), but that is exactly the point of a post-exploitation persistence mechanism. The operator registers their DLL and, optionally, forces a trigger:

netsh add helper C:\ProgramData\evil.dll
schtasks /create /tn "NetCfg" /tr "netsh interface show interface" /sc onlogon /ru SYSTEM

From that point, every logon runs netsh, netsh loads evil.dll, and the DLL's entry point fires. The scheduled command itself is benign-looking — it is the helper registration that carries the payload.

Hunting for it

The single most valuable artifact is the contents of the NetSh key. Dump it and compare against a known-good baseline:

reg query "HKLM\SOFTWARE\Microsoft\NetSh"

Or in PowerShell, which makes diffing easier:

Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\NetSh" |
  Select-Object * -ExcludeProperty PS* |
  Format-List

Then apply these judgment calls:

  1. Unexpected DLL names. The legitimate set is small and stable across a given Windows build. Anything outside that set — especially names mimicking real helpers — is suspicious.
  2. Non-system paths. Genuine helpers resolve out of C:\Windows\System32. A value pointing at ProgramData, a user profile, Temp, or a UNC path is a red flag.
  3. Unsigned or oddly-signed DLLs. Resolve each referenced DLL and check its Authenticode signature. Microsoft helpers are Microsoft-signed; a self-signed or unsigned binary here is almost never legitimate.
  4. Recently-modified entries. Correlate the key's last-write time with your change windows. Persistence often lands right after initial access.

For live detection, watch Sysmon: Event ID 7 (Image Loaded) where the loading process is netsh.exe and the loaded module is not in System32 catches this cleanly. Event ID 13 (Registry Value Set) on the NetSh key catches the installation moment itself.

Hardening and remediation

Remove a rogue entry with netsh delete helper evil.dll, then delete the payload DLL and any trigger task. To reduce exposure going forward:

Where WinSentinel fits

Persistence lives in dozens of these obscure extension points, and no human checks all of them by hand on every machine. WinSentinel's persistence auditing enumerates the NetSh helper hive alongside the rest — services, scheduled tasks, autostart, COM hijacks, WMI subscriptions — resolves each referenced DLL, checks its path and signature, and flags anything that deviates from the expected Microsoft baseline. Every one of the 33 audit modules runs at full power on a single machine for free, with no limits — you get the complete persistence sweep on your own box without paying anything.

For organizations, WinSentinel Pro takes that same audit and orchestrates it across a fleet from a central node: run the persistence sweep on 50 or 500 endpoints on a schedule, roll findings up into a single view, and get drift alerts the moment a new helper DLL appears anywhere in the estate. A netsh persistence entry that would sit unnoticed on one workstation becomes a fleet-wide detection the instant it lands.

Persistence hunting is a coverage problem, not a cleverness problem. The techniques are known; the failure is that nobody audits all of them, everywhere, all the time. Automate the sweep and the netsh helper hive stops being a blind spot.