Winlogon

MITRE ATT&CK™ Boot or Logon Autostart Execution: Winlogon Helper DLL - Technique T1547.001

Theory

Winlogon, the Windows component that loads your user profile right after authentication. It can be abuse for persistence. We may edit the Shell, Userinit & Notify keys under HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\ to make Winlogon load and execute malicious DLLs and/or executables.

Practice

Registry entries under HKU/HKCU will only apply to the user. Registry entries under HKLM will apply to everyone

If we'd replace any of the executables with some reverse shell, we would break the logon sequence, which isn't desired. Interestingly, you can append commands separated by a comma, and Winlogon will process them all.

We may edit the Userinit key to make our payload executed during Windows logon

  • HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit

  • HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit

reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Userinit /d "C:\Windows\System32\Userinit.exe, C:\Windows\shell.exe" /f

Resources

Last updated