The cheapest way to survive a reboot is to ask the operating system to start your code for you, and every major platform offers dozens of places to make that request. MITRE ATT&CK T1547 Boot or Logon Autostart Execution covers configuring system settings so a program runs automatically at boot or logon, for persistence and sometimes for higher privileges. In ATT&CK v20 it belongs to both the Persistence (TA0003) and Privilege Escalation (TA0004) tactics and has 14 active sub-techniques, from Registry Run keys and startup folders to LSA authentication packages, print spooler DLLs, Linux XDG autostart entries and macOS login items. T1547.001 alone is recorded for 197 malware families and 59 groups, which makes it one of the most common persistence methods in the knowledge base. This guide explains each autostart location defenders must watch, how to detect changes to them, how to harden the riskiest ones and how to evict entries cleanly. It is for detection engineers, incident responders and endpoint owners. For the full persistence landscape, see the Persistence Techniques Guide.
Key takeaways
- Monitor the locations, not the malware. Autostart persistence must write to a known, finite set of registry keys, folders and configuration files, so change monitoring on those locations catches unknown tools.
- Run keys and startup folders dominate. T1547.001 covers most real-world use; a detection on new Run and RunOnce values and new startup-folder files pays off quickly.
- LSA-loaded DLLs are the dangerous minority. Authentication packages, security support providers and LSASS drivers run inside LSASS, and SSPs can see plaintext credentials; Added LSA protection (RunAsPPL) blocks unsigned plug-ins.
- Baselines make detection workable. Autoruns or EDR inventories from a gold image let you alert on what is new and unsigned, rather than on every software install.
- Eviction needs the full list. Removing one Run key while a print monitor or Active Setup entry remains leaves the intruder in place.
How the attack works
ATT&CK describes T1547 as configuring system settings "to automatically execute a program during system boot or logon", through specially designated directories, configuration repositories such as the Registry, or kernel extensions. Programs started this way run with the privileges of the context that loads them: the logged-on user for Run keys, SYSTEM for print spooler and LSA components.
| Sub-technique (v20) | Location defenders watch | Runs as | ATT&CK detection |
|---|---|---|---|
| .001 Registry Run Keys / Startup Folder | HKLM and HKCU ...\CurrentVersion\Run, RunOnce, RunOnceEx, Policies\Explorer\Run; Shell Folders and User Shell Folders values; Session Manager\BootExecute; per-user and all-users Startup folders | Logged-on user (BootExecute: at boot) | DET0365 |
| .002 Authentication Package | HKLM\SYSTEM\CurrentControlSet\Control\Lsa\ "Authentication Packages" | LSASS (SYSTEM) | DET0207 |
| .003 Time Providers | HKLM\System\CurrentControlSet\Services\W32Time\TimeProviders\ | W32Time service | DET0122 |
| .004 Winlogon Helper DLL | HKLM and HKCU ...\Windows NT\CurrentVersion\Winlogon\ values such as Shell, Userinit and Notify | Winlogon at logon | DET0404 |
| .005 Security Support Provider | Lsa\Security Packages and Lsa\OSConfig\Security Packages | LSASS, with access to plaintext and encrypted credentials | DET0542 |
| .008 LSASS Driver | LSA plug-ins and drivers loaded by LSASS | LSASS | DET0225 |
| .009 Shortcut Modification | Shortcuts and symbolic links in startup locations or pointing to altered targets | User | DET0180 |
| .010 Port Monitors | HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors | spoolsv.exe as SYSTEM | DET0204 |
| .012 Print Processors | Print processor DLLs registered with the spooler (needs SeLoadDriverPrivilege) | spoolsv.exe as SYSTEM | DET0026 |
| .014 Active Setup | HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\ StubPath values | User, at logon | DET0312 |
| .006 Kernel Modules and Extensions | Linux loadable kernel modules (/lib/modules, insmod, modprobe); macOS kernel extensions | Kernel | DET0450 |
| .013 XDG Autostart Entries | .desktop files in /etc/xdg/autostart and ~/.config/autostart | User, at desktop login | DET0390 |
| .007 Re-opened Applications; .015 Login Items | ~/Library/Preferences/ByHost/com.apple.loginwindow.[UUID].plist; login items and background tasks | User, at login | DET0125, DET0121 |
Microsoft's documentation of the Run and RunOnce keys explains some behaviour that matters in investigations: a RunOnce value is deleted before its command runs unless its name starts with !, a * prefix makes it run even in Safe Mode, HKLM RunOnce entries run only when an administrator logs on, the command line is limited to 260 characters, and the order in which entries under one key run is indeterminate. A RunOnce entry may therefore have executed and vanished before you look, which is why registry change telemetry beats point-in-time scans.
Where it shows up
- Commodity malware and loaders: Run keys and startup-folder shortcuts are the default persistence for most infostealers and remote access trojans. See the Infostealer Threat Guide.
- State and criminal groups: ATT&CK records APT29 adding Run keys, FIN7 creating Run and RunOnce keys and Startup folder items, Kimsuky placing scripts in the startup folder and modifying HKCU RunOnce, and Lazarus Group using both startup folders and Run keys. See the APT29 (Midnight Blizzard) Threat Actor Profile.
- Credential capture: malicious security support providers persist and collect passwords at the same time, overlapping with T1556 Modify Authentication Process.
- SYSTEM-level persistence through the print spooler: port monitors and print processors load at boot under spoolsv.exe.
- Linux desktops and servers: XDG autostart on workstations and kernel modules on servers, often alongside systemd units covered by T1543.
Impact
Autostart persistence turns a one-time compromise into a durable one: the intruder returns after every reboot, password reset or partial clean-up. LSA and spooler variants also deliver SYSTEM execution or credential access, and kernel modules can hide other activity entirely. During incident response, an unfound autostart entry is a common reason for reinfection after a declared recovery.
Detection
| Platform | Telemetry | What to alert on |
|---|---|---|
| Windows registry autostarts | Sysmon 12, 13 and 14 (registry create, value set, rename) or EDR registry events; Security 4657 with auditing (SACLs) on the keys | New or changed values under the keys in the table above, especially pointing to user-writable paths, scripts, LOLBAS binaries or unsigned files (DET0365, DET0274) |
| Startup folders and shortcuts | Sysmon 11 (file create), EDR file events | New .lnk, script or executable files in either Startup folder; shortcuts whose target changed (DET0180) |
| LSA plug-ins | Sysmon 7 (image loaded) into lsass.exe; Security 4657; CodeIntegrity Operational events 3033, 3063, 3065, 3066 | New entries in Authentication Packages or Security Packages; any non-Microsoft DLL loading into LSASS (DET0542, DET0207, DET0225) |
| Spooler and time service | Sysmon 7 into spoolsv.exe and svchost hosting W32Time; registry events | New monitors, print processors or time provider DLLs, especially on servers that do not print (DET0204, DET0026, DET0122) |
| Logon behaviour | Security 4688 or Sysmon 1 with parent process | Processes spawned at logon by explorer.exe, userinit.exe or winlogon.exe that are not in the baseline (DET0404, DET0274) |
| Linux | auditd watches on /etc/xdg/autostart, ~/.config/autostart, /lib/modules; execve of insmod and modprobe | New .desktop files with unusual Exec paths; unsigned or unexpected module loads (DET0390, DET0450) |
| macOS | Endpoint Security and unified log; sfltool dumpbtm for background task inventory | New login items and background tasks from unknown team identifiers; changes to loginwindow plists (DET0121, DET0125) |
Baselining with Autoruns
Sysinternals Autoruns (v14.3) and its command-line form autorunsc enumerate logon entries, services, scheduled tasks, Winlogon, boot execute, AppInit DLLs, image hijacks, WMI entries, printer monitor DLLs and LSA providers. A practical baseline uses all categories, CSV output, hashes and signature verification across all profiles, for example autorunsc -a * -c -h -s *, collected from a gold image and then regularly from each host. Diff the results and investigate entries that are new, unsigned or point to user-writable paths. Many EDR platforms provide the same inventory natively. For hunting queries, see the KQL for Threat Hunting Guide.
Prevention and hardening
| Control | Setting or approach | Sub-techniques addressed |
|---|---|---|
| Added LSA protection | RunAsPPL under HKLM\SYSTEM\CurrentControlSet\Control\Lsa (1 with UEFI lock, 2 without on Windows 11 22H2 and later); test first with AuditLevel=8 under Image File Execution Options for LSASS.exe and review CodeIntegrity events. LSA plug-ins and drivers must then be Microsoft-signed | .002, .005, .008 (ATT&CK M1025) |
| Application control | Block execution from user-writable paths and unsigned code; most Run key and startup-folder payloads then fail to start. See the Application Allowlisting Guide | .001, .009, .014 (M1038) |
| Least privilege | No local administrator rights for users; HKLM keys, LSA, spooler and Winlogon changes then need admin. For local admin accounts see the Local Administrator Password Solution (LAPS) Guide | All HKLM-based variants (M1018, M1026) |
| Disable unneeded services | Stop and disable the Print Spooler on servers and domain controllers that do not print | .010, .012 (M1042) |
| Registry permissions | Keep default ACLs on autostart keys; audit changes with SACLs | .003 and other HKLM keys (M1024) |
| Linux module and autostart control | Secure Boot with module signature enforcement where supported, restrict write access to XDG directories, limit software installation | .006, .013 (M1022, M1033) |
| macOS managed login items | Use the Managed Login Items payload with Label, BundleIdentifier or TeamIdentifier rules to pre-approve known items so unknown ones stand out. See the macOS Security Guide for Enterprises | .015, .007 |
Rollout and eviction
- Baseline: collect Autoruns or EDR autostart inventories from gold images and a sample of production hosts per role.
- Detect in alert-only mode: enable registry and file monitoring on the locations above and tune out software deployment tools for two to four weeks.
- Harden: enable LSA protection in audit mode, review CodeIntegrity events, then enforce; disable the spooler where unneeded; remove local admin rights.
- Evict during incidents: export every autostart location from affected hosts, compare against baseline, remove all malicious entries and their files together, then reboot and recheck. See the EDR Guide for remote collection.
- Roll back: LSA protection set without a UEFI lock can be reverted by registry change and restart; with a UEFI lock it needs Microsoft's opt-out tool, so pilot before using value 1.
Where identity fits
Most autostart locations that matter need administrator rights to change, so this technique is often a symptom of over-privileged local admin and service accounts. Remove standing local admin, rotate local administrator passwords with LAPS, and monitor service accounts that write to autostart keys. Malicious SSPs and authentication packages are also a credential-theft risk to every account that logs on to the host. See the Service Account Security Guide.
Common failure patterns
- Watching only Run and RunOnce: intruders who know the common rules use Active Setup, Winlogon values, print monitors or Policies\Explorer\Run instead.
- Point-in-time scans only: RunOnce entries delete themselves, so a weekly scan may never see them. Stream registry change events.
- No baseline: every software install generates autostart entries; without a baseline the alerts are ignored.
- Leaving the spooler running on servers: it provides SYSTEM-level autostart paths with no business value.
- Partial eviction: deleting the file but not the registry entry, or one entry but not the second persistence method, leads to reinfection.
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| MITRE ATT&CK v20 | T1547 and 14 sub-techniques (TA0003, TA0004); related T1543, T1037, T1053, T1546 | The technique and neighbouring persistence techniques |
| ATT&CK mitigations | M1025, M1024, M1022, M1018, M1038, M1042, M1026, M1033 | Official mitigations across sub-techniques |
| NIST SP 800-53 Rev. 5 | CM-7(5) Authorized Software; AC-6 Least Privilege | Execution control and admin rights |
| NIST SP 800-53 Rev. 5 | SI-7 Software, Firmware, and Information Integrity; SI-4 System Monitoring | Integrity checks on autostart locations; change monitoring |
| NIST CSF 2.0 | PR.PS-01; PR.PS-05; DE.CM-09 | Configuration management; preventing unauthorised software; monitoring |
Practitioner checklist
- Stream registry and file change telemetry for every T1547 location on Windows, not only Run and RunOnce.
- Alert on any non-Microsoft DLL loading into LSASS and on changes to LSA package values.
- Enable Added LSA protection, audit mode first, then enforce on all supported systems.
- Disable the Print Spooler on servers and domain controllers that do not need it.
- Baseline autostarts per host role with Autoruns or EDR inventory and diff regularly.
- Remove standing local admin rights and use LAPS for local administrator accounts.
- Monitor XDG autostart directories and kernel module loads on Linux, and login items on macOS.
- During incident response, export and clear every autostart location, then reboot and recheck.
Standards and references
- MITRE ATT&CK: Boot or Logon Autostart Execution (T1547)
- MITRE ATT&CK: Registry Run Keys / Startup Folder (T1547.001)
- Microsoft: Run and RunOnce Registry Keys
- Microsoft: Configure added LSA protection
- Microsoft Sysinternals: Autoruns
- Microsoft Sysinternals: Sysmon
- Apple: Manage login items and background tasks on Mac
- NIST: SP 800-53 Rev. 5 Security and Privacy Controls
Related NHI Mgmt Group resources: Persistence Techniques Guide · T1543 Create or Modify System Process Defensive Guide · T1546 Event Triggered Execution Defensive Guide · Sysmon Guide · Local Administrator Password Solution (LAPS) Guide