Boot or Logon Autostart Execution
Adversaries may configure system settings to automatically execute a program during system boot or logon to maintain persistence or gain higher-level privileges on compromised systems. Operating systems may have mechanisms for automatically running a program on system boot or account logon, including automatically executing programs that are placed in specially designated directories or are referenced by repositories that store configuration information, such as the Windows Registry. An adversary may achieve the same goal by modifying or extending features of the kernel. Since some boot or logon autostart programs run with higher privileges, an adversary may leverage these to elevate privileges.
let RunKeyPaths = dynamic([
"\\CurrentVersion\\Run",
"\\CurrentVersion\\RunOnce",
"\\CurrentVersion\\RunOnceEx",
"\\CurrentVersion\\RunServices",
"\\CurrentVersion\\RunServicesOnce",
"\\CurrentVersion\\Policies\\Explorer\\Run",
"\\CurrentVersion\\Winlogon",
"\\Active Setup\\Installed Components",
"\\Control\\Lsa\\Authentication Packages",
"\\Control\\Lsa\\Security Packages",
"\\Control\\Print\\Monitors",
"\\Control\\Print\\Environments",
"\\Services\\W32Time\\TimeProviders",
"\\CurrentVersion\\Explorer\\Shell Folders",
"\\CurrentVersion\\Explorer\\User Shell Folders"
]);
DeviceRegistryEvents
| where Timestamp > ago(24h)
| where ActionType in ("RegistryValueSet", "RegistryKeyCreated")
| where RegistryKey has_any (RunKeyPaths)
| project Timestamp, DeviceName, ActionType, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessAccountName
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Software installations that register legitimate autostart entries in Run keys
- Windows Updates or Group Policy changes modifying Winlogon or Shell Folders registry keys
- Print driver installations that add legitimate port monitors or print processors
- Enterprise IT tools (SCCM, Intune, GPO) deploying startup configurations
References (6)
- https://attack.mitre.org/techniques/T1547/
- https://learn.microsoft.com/en-us/windows/win32/setupapi/run-and-runonce-registry-keys
- https://technet.microsoft.com/en-us/sysinternals/bb963902
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1547/T1547.md
- https://github.com/SigmaHQ/sigma/tree/master/rules/windows/registry_set
- https://web.archive.org/web/20160214140250/http://blog.cylance.com/windows-registry-persistence-part-2-the-run-keys-and-search-order
Unlock Pro Content
Get the full detection package for T1547 including response playbook, investigation guide, and atomic red team tests.
Related Detections
Sub-techniques (14)
- T1547.001Registry Run Keys / Startup Folder
- T1547.002Authentication Package
- T1547.003Time Providers
- T1547.004Winlogon Helper DLL
- T1547.005Security Support Provider
- T1547.006Kernel Modules and Extensions
- T1547.007Re-opened Applications
- T1547.008LSASS Driver
- T1547.009Shortcut Modification
- T1547.010Port Monitors
- T1547.012Print Processors
- T1547.013XDG Autostart Entries
- T1547.014Active Setup
- T1547.015Login Items