Winlogon Helper DLL
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.
let WinlogonValues = dynamic(["Shell", "Userinit", "Notify", "VmApplet", "AppSetup", "Taskman"]);
let DefaultShell = "explorer.exe";
let DefaultUserinit = "C:\\Windows\\system32\\userinit.exe,";
DeviceRegistryEvents
| where Timestamp > ago(24h)
| where ActionType == "RegistryValueSet"
| where RegistryKey has "\\Windows NT\\CurrentVersion\\Winlogon"
| where RegistryValueName in~ (WinlogonValues)
| where not(RegistryValueData =~ DefaultShell and RegistryValueName =~ "Shell")
| where not(RegistryValueData =~ DefaultUserinit and RegistryValueName =~ "Userinit")
| project Timestamp, DeviceName, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessAccountName
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Custom shell replacements in kiosk or thin-client environments
- Enterprise login scripts that legitimately modify Userinit to chain additional executables
- Accessibility tools or custom logon screen providers that modify Winlogon values
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.