Persistence through Run Key is a Windows persistence technique that causes a program to start automatically when a user signs in. It works by placing a value in a registry Run or RunOnce location, so the payload is launched at logon and can survive reboots and normal user sessions.
What Persistence Through Run Key Does
Persistence through a Run Key is a Windows autostart technique that places a program reference in a registry Run or RunOnce location so it launches when a user signs in. Because the registry entry is checked at logon, the payload can keep starting across reboots and normal user sessions without needing a separate scheduled task or service.
This makes the technique simple, durable and attractive to attackers who want a low-friction foothold. The persistence point is tied to a common user activity, so it can blend into ordinary startup behaviour unless defenders baseline expected autoruns.
Where Run Key Persistence Lives in Windows
Run and RunOnce keys are part of the Windows registry locations that control user logon startup behaviour. Depending on placement, the entry may run once, or every time the user signs in, which is why this technique is often grouped under boot or logon autostart execution. It is one of several ways to establish persistence, alongside startup folders, services, scheduled tasks and other autoruns.
From a defender’s view, the important detail is not just that a value exists, but which hive, key path and user context it lives under. Per-user locations are especially useful to an attacker because they can persist without requiring full machine-wide service configuration changes.
For a broader map of how this technique fits into Windows persistence tradecraft, the Persistence Techniques Guide shows the surrounding autostart methods, and the T1547 Boot or Logon Autostart Execution Defensive Guide places Run keys in the wider ATT&CK persistence family.
Why Run Key Persistence Is Dangerous
Run Key persistence gives an intruder repeatable execution with very little operational overhead. Once established, it can help malware survive routine user logoffs, avoid simple process-kill remediation and maintain access long enough for credential theft, lateral movement or follow-on payload delivery.
It is also dangerous because defenders may focus on the visible payload and miss the registry change that keeps restoring it. If the attacker has already gained user context, registry write access or another foothold that can edit autoruns, the persistence mechanism can be re-established after cleanup unless the underlying startup entry is removed.
Cases that involve registry-based persistence are often paired with additional deception, such as masquerading executables, benign-looking paths or adjacent autorun modifications. For registry-focused investigation, the Windows Registry Forensics Guide helps analysts inspect Run and RunOnce keys, and the Windows Internals for Defenders Guide provides the registry and token context that makes these entries matter operationally.
How Defenders Find and Remove Run Key Persistence
Exposure is usually checked through endpoint inventory, registry inspection, autoruns baselines and comparison against known-good startup entries. On a compromised host, analysts should review the exact value data, the launching user context and the timestamp trail around the registry modification, then compare it with nearby logon activity and process creation evidence.
Removal is not just deleting the registry value. A complete response also verifies that the launched payload, any dropped helper files and any secondary persistence paths are gone, then confirms the Run or RunOnce location stays clean across a fresh logon. The How to Hunt for Persistence on Windows guide covers query patterns and triage methods for finding rare autoruns, while the D3-RKD Registry Key Deletion guide shows how to prove malicious keys have actually been removed.
Risk and Threat Considerations
Run Key persistence is especially risky because it turns a one-time foothold into repeatable execution at every sign-in. That makes it a durable staging point for credential theft, secondary payloads and re-entry after a partial cleanup.
Failure mechanism: An attacker writes a Run or RunOnce value that points to malicious code, then relies on logon processing to relaunch the payload whenever the user signs in.
Impact: The host can keep re-infecting itself through normal user activity, which raises the chance of continued access, repeated command execution and missed compromise during remediation.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
MITRE ATT&CK and OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| MITRE ATT&CK | T1547.001 — Registry Run Keys / Startup Folder | Run key persistence is ATT&CK autostart execution via registry run keys. |
| Recommendation — Map the autorun entry to T1547.001 and hunt for the registry value, payload and launch context. | ||
| NIST SP 800-53 Rev 5 | AU-12 — Audit Record Generation | Registry autorun changes require auditable evidence to support detection and investigation. |
| CM-7 — Least Functionality | Reducing unnecessary autorun paths lowers the attack surface for Run key persistence. | |
| Recommendation — Log registry autorun modifications so analysts can reconstruct when Run key persistence was created. Disable unnecessary startup mechanisms and remove unneeded autorun locations from standard builds. | ||
| CIS Controls v8 | CIS-8 — Audit Log Management | Run key persistence is found and validated through endpoint logging and registry telemetry. |
| Recommendation — Collect and review endpoint logs and registry telemetry for unexpected autorun changes. | ||
| OWASP Non-Human Identity Top 10 | NHI-05 — Overprivileged NHI | When the autorun launches a non-human workload or agent, excess privilege makes persistence more damaging. |
| Recommendation — Limit the privileges of any non-human process that can launch from startup paths. | ||
Practitioner Guidance
What to watch for: Treat unexpected autoruns as a persistence problem, not just a suspicious file problem. The key question is whether the registry value, its target binary and its launch context are all consistent with approved software and normal user behaviour.
Practitioner takeaway: If you remove the payload but do not remove the Run key entry, the persistence mechanism remains intact and the compromise can return on the next logon.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org