Detect Winlogon Helper DLL in Elastic Security
Adversaries may abuse features of Winlogon to execute DLLs and/or executables when a user logs in. Winlogon.exe is a Windows component responsible for actions at logon/logoff as well as the secure attention sequence (SAS) triggered by Ctrl-Alt-Delete. Registry entries in HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\ and HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\ are used to manage additional helper programs. Malicious modifications to these Registry keys may cause Winlogon to load and execute malicious DLLs and/or executables. Specifically, the Winlogon\Notify, Winlogon\Userinit, and Winlogon\Shell subkeys are known targets for abuse by threat actors including Turla, Wizard Spider, and LockBit.
MITRE ATT&CK
- Tactic
- Persistence Privilege Escalation
- Technique
- T1547 Boot or Logon Autostart Execution
- Sub-technique
- T1547.004 Winlogon Helper DLL
- Canonical reference
- https://attack.mitre.org/techniques/T1547/004/
Elastic Detection Query
registry where registry.path : ("*\\Windows NT\\CurrentVersion\\Winlogon\\Shell", "*\\Windows NT\\CurrentVersion\\Winlogon\\Userinit", "*\\Windows NT\\CurrentVersion\\Winlogon\\Notify", "*\\Windows NT\\CurrentVersion\\Winlogon\\VmApplet", "*\\Windows NT\\CurrentVersion\\Winlogon\\AppSetup", "*\\Windows NT\\CurrentVersion\\Winlogon\\Taskman") and not (
(registry.value == "Shell" and registry.data.strings : ("explorer.exe")) or
(registry.value == "Userinit" and registry.data.strings : ("C:\\Windows\\system32\\userinit.exe,"))
) Detects modifications to Winlogon registry subkeys (Shell, Userinit, Notify, VmApplet, AppSetup, Taskman) under HKLM or HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon. Excludes known-good default values for Shell and Userinit. Adversary groups including Turla, Wizard Spider, and LockBit have abused these keys for persistence and credential access.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate software installers (e.g., Citrix, VMware Horizon) that modify Shell or Userinit during installation
- Group Policy or SCCM deployments that temporarily set custom Userinit wrappers during OS provisioning
- Enterprise endpoint management agents (e.g., Tanium, BigFix) that write to Winlogon keys during configuration management operations
Other platforms for T1547.004
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Modify Winlogon Shell to Append Malicious Binary
Expected signal: Sysmon Event ID 13: RegistryValueSet on HKCU\...\Winlogon\Shell with value containing 'explorer.exe, C:\Windows\System32\calc.exe'.
- Test 2Modify Winlogon Userinit to Chain Malicious Binary
Expected signal: Sysmon Event ID 13: RegistryValueSet on HKLM\...\Winlogon\Userinit showing the appended executable path.
- Test 3Create Winlogon Notify Key
Expected signal: Sysmon Event ID 12: Key created for the Notify subkey. Sysmon Event ID 13: Value set for DllName.
References (4)
- https://attack.mitre.org/techniques/T1547/004/
- https://web.archive.org/web/20160214140250/http://blog.cylance.com/windows-registry-persistence-part-2-the-run-keys-and-search-order
- https://technet.microsoft.com/en-us/sysinternals/bb963902
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1547.004/T1547.004.md
Unlock Pro Content
Get the full detection package for T1547.004 including response playbook, investigation guide, and atomic red team tests.