T1547

Boot or Logon Autostart Execution

Persistence Privilege Escalation Last updated:

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.

What is T1547 Boot or Logon Autostart Execution?

Boot or Logon Autostart Execution (T1547) maps to the Persistence and Privilege Escalation tactics — the adversary is trying to maintain their foothold in MITRE ATT&CK.

This page provides production-ready detection logic for Boot or Logon Autostart Execution, covering the data sources and telemetry it touches: Windows Registry: Windows Registry Key Modification, Windows Registry: Windows Registry Key Creation, Microsoft Defender for Endpoint. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Persistence Privilege Escalation
Technique
T1547 Boot or Logon Autostart Execution
Canonical reference
https://attack.mitre.org/techniques/T1547/
Microsoft Sentinel / Defender
kusto
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

Broad detection for modifications to any Windows autostart registry locations including Run/RunOnce keys, Winlogon helpers, Active Setup, LSA packages, print monitors, and time providers. Uses DeviceRegistryEvents from Microsoft Defender for Endpoint to catch registry value sets and key creations across all known boot/logon autostart persistence paths.

high severity medium confidence

Data Sources

Windows Registry: Windows Registry Key Modification Windows Registry: Windows Registry Key Creation Microsoft Defender for Endpoint

Required Tables

DeviceRegistryEvents

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

Sigma rule & cross-platform mapping

The detection logic for Boot or Logon Autostart Execution (T1547) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  product: windows

Browse the community-maintained Sigma rules for this technique:


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.

  1. Test 1Add Registry Run Key for Persistence

    Expected signal: Sysmon Event ID 13: Registry value set on HKCU\Software\Microsoft\Windows\CurrentVersion\Run with value name 'df00tech-test'. DeviceRegistryEvents with ActionType 'RegistryValueSet'.

  2. Test 2Drop File in Startup Folder

    Expected signal: Sysmon Event ID 11: FileCreate in the Startup directory. DeviceFileEvents with ActionType 'FileCreated' in the Startup folder path.

  3. Test 3Modify Winlogon Shell Value

    Expected signal: Sysmon Event ID 13: Registry value set on Winlogon\Shell. DeviceRegistryEvents with RegistryKey containing 'Winlogon' and RegistryValueName 'Shell'.


Response Playbook

Triage

  1. Identify which specific autostart mechanism was modified — Run key, Winlogon, Active Setup, LSA, print spooler, or time provider. Each has different severity implications.
  2. Examine the registry value data — does it point to a known legitimate executable or an unusual path (e.g., temp directories, user writable locations, encoded paths)?
  3. Check the initiating process — was the registry modification made by an expected installer, GPO engine (svchost.exe -k netsvcs), or an unusual process like cmd.exe, powershell.exe, or a script host?
  4. Verify the user context — is this a standard user, service account, or administrator? LSA and print spooler modifications require elevated privileges.
  5. Cross-reference with recent software deployments or change tickets to determine if the change is authorized.
  6. Look for temporal clustering — multiple autostart modifications in a short window may indicate an automated attack framework.

Containment

  1. If malicious: remove the registry entry immediately using reg delete or PowerShell Remove-ItemProperty
  2. If the referenced binary is on disk: quarantine the file and collect a hash for IOC sharing
  3. If LSA or Winlogon modifications detected: isolate the endpoint — these indicate high-privilege compromise
  4. If multiple endpoints affected: assess for lateral movement and consider domain-wide credential reset
  5. Enable LSA Protection (RunAsPPL) on affected endpoints if not already configured

Evidence Collection

  1. Registry export of the modified key and all subkeys using reg export
  2. File hash (SHA256) and metadata of the referenced binary
  3. Sysmon Event IDs 12/13/14 for the registry modification timeline
  4. Process creation logs (Sysmon EID 1 / Security EID 4688) for the initiating process tree
  5. Autoruns output (Sysinternals) for a complete view of all autostart locations on the endpoint
  6. Memory dump if a rootkit or in-memory-only payload is suspected

Escalation Criteria

  • ! Any modification to LSA Authentication Packages or Security Packages — indicates credential theft capability
  • ! Winlogon Shell or Userinit modification — indicates boot-level persistence with potential for all-user impact
  • ! Registry value pointing to a binary in a temporary directory, recycle bin, or user-writable system path
  • ! Multiple distinct autostart mechanisms modified on the same endpoint (defense in depth persistence)
  • ! Same autostart modification observed across multiple endpoints simultaneously

Investigation Guide

Forensic Artifacts

  • > Registry: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run and RunOnce
  • > Registry: HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run and RunOnce
  • > Registry: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon (Shell, Userinit, Notify)
  • > Registry: HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{GUID}\StubPath
  • > Registry: HKLM\SYSTEM\CurrentControlSet\Control\Lsa (Authentication Packages, Security Packages)
  • > Registry: HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors and Print Processors
  • > File System: C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
  • > File System: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
  • > Sysinternals Autoruns output comparing against known-good baseline

Tuning Guidance

This parent-level detection is intentionally broad and will generate significant volume. It is best used as a hunting query or for environments building initial visibility. For production alerting, deploy the sub-technique-specific detections (T1547.001 through T1547.015) which have more targeted logic and lower false positive rates. Start by baselining known-good autostart entries using Sysinternals Autoruns across your fleet. Exclude entries from trusted installers (msiexec.exe, TrustedInstaller.exe, SCCM client) and focus alerts on modifications from interactive processes (explorer.exe, cmd.exe, powershell.exe) or unusual parent processes.


Hunting Queries

Hunt for unique Run key values that appear on only one device — these are more likely malicious than values deployed widely by enterprise software.

Hunting — KQL
kql
DeviceRegistryEvents
| where Timestamp > ago(7d)
| where ActionType == "RegistryValueSet"
| where RegistryKey has "\\CurrentVersion\\Run"
| summarize Count=count(), Devices=dcount(DeviceName) by RegistryValueData
| where Devices == 1
| sort by Count asc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=13 TargetObject="*\\CurrentVersion\\Run*"
| stats count as Count, dc(host) as Devices by Details
| where Devices == 1
| sort Count

Hunt for modifications to high-value autostart locations (Winlogon, LSA, Active Setup) by processes other than known Windows servicing components.

Hunting — KQL
kql
DeviceRegistryEvents
| where Timestamp > ago(7d)
| where ActionType == "RegistryValueSet"
| where RegistryKey has_any ("\\Winlogon", "\\Lsa", "\\Active Setup")
| where InitiatingProcessFileName !in~ ("msiexec.exe", "svchost.exe", "TiWorker.exe", "TrustedInstaller.exe")
| project Timestamp, DeviceName, RegistryKey, RegistryValueData, InitiatingProcessFileName
| sort by Timestamp desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=13 (TargetObject="*\\Winlogon*" OR TargetObject="*\\Lsa\\*" OR TargetObject="*Active Setup*") NOT (Image="*\\msiexec.exe" OR Image="*\\svchost.exe" OR Image="*\\TiWorker.exe" OR Image="*\\TrustedInstaller.exe")
| table _time, host, TargetObject, Details, Image
| sort - _time

Hunt for new files created in the Startup folder — a common and simple persistence mechanism used by many malware families and threat actors.

Hunting — KQL
kql
DeviceFileEvents
| where Timestamp > ago(7d)
| where FolderPath has "Start Menu\\Programs\\Startup"
| where ActionType == "FileCreated"
| project Timestamp, DeviceName, FileName, FolderPath, InitiatingProcessFileName, InitiatingProcessCommandLine, SHA256
| sort by Timestamp desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=11 TargetFilename="*Start Menu\\Programs\\Startup*"
| table _time, host, TargetFilename, Image, User
| sort - _time

Atomic Red Team Tests

Test 1 Add Registry Run Key for Persistence
windows

Creates a Run key entry in HKCU that would execute calc.exe at user logon. This is the most common autostart persistence mechanism used by malware.

Command

powershell
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v df00tech-test /t REG_SZ /d "C:\Windows\System32\calc.exe" /f

Cleanup

powershell
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v df00tech-test /f

Expected Telemetry

Sysmon Event ID 13: Registry value set on HKCU\Software\Microsoft\Windows\CurrentVersion\Run with value name 'df00tech-test'. DeviceRegistryEvents with ActionType 'RegistryValueSet'.

Expected Detection

Alert fires on Run key path match. Both KQL and SPL queries will capture this event with the full registry path and value data.

Test 2 Drop File in Startup Folder
windows

Places a benign batch script in the current user's Startup folder. The script will execute at next logon. Many malware families use this simple persistence method.

Command

powershell
echo echo df00tech-test > "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\df00tech-test.bat"

Cleanup

powershell
del "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\df00tech-test.bat"

Expected Telemetry

Sysmon Event ID 11: FileCreate in the Startup directory. DeviceFileEvents with ActionType 'FileCreated' in the Startup folder path.

Expected Detection

Hunting query for Startup folder file creation will detect this. The file creation event captures the full path and initiating process.

Test 3 Modify Winlogon Shell Value
windows

Modifies the Winlogon Shell registry value to append a secondary executable. This technique is used by sophisticated malware like Gazer (Turla) and LockBit to achieve boot-level persistence.

Command

powershell
reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "explorer.exe, C:\Windows\System32\calc.exe" /f

Cleanup

powershell
reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "explorer.exe" /f

Expected Telemetry

Sysmon Event ID 13: Registry value set on Winlogon\Shell. DeviceRegistryEvents with RegistryKey containing 'Winlogon' and RegistryValueName 'Shell'.

Expected Detection

Alert fires on Winlogon registry path match. The detection captures the modified Shell value showing the appended executable.

Related Detections