Persistence through a Run key.
What gives it awayA value written to a Run or RunOnce key by a shell, a scripting engine, or a process in a temp directory rather than by an installer.
ATT&CK T1547.001Nothing matches that yet. Tell us what you were looking for and it goes on the list.
Sysmon · Event 13
Something wrote a value into the registry. Filtered to the keys that cause code to run at startup, it is one of the most direct persistence detections available — and unlike file-based persistence, there is nothing on disk to notice.
Also written as Sysmon 13Sysmon Event ID 13RegistryEvent value setSysmon registry value set
Only present if you installed Sysmon. Windows writes registry values constantly as part of normal operation.
Sysmon splits registry activity across events 12, 13, and 14 — key creation and deletion, value set, and rename. Event 13 is where persistence is written. Filter the configuration to Run keys, service configuration, Winlogon, image file execution options, and security product settings. Note that Sysmon abbreviates hive names, writing HKLM rather than HKEY_LOCAL_MACHINE, which breaks naive string matching.
Sanitised. Addresses come from the RFC 5737 documentation ranges.
Registry value set:
RuleName: T1547.001
EventType: SetValue
UtcTime: 2026-08-28 09:14:11.552
ProcessGuid: {a1b2c3d4-0000-0000-0000-00000000abcd}
ProcessId: 7412
Image: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
TargetObject: HKU\S-1-5-21-0000000000-0000000000-0000000000-1001\Software\Microsoft\Windows\CurrentVersion\Run\Updater
Details: "C:\Users\jbrooks\AppData\Local\Temp\wh.exe"
User: CORP\jbrooks Everything else in the log line is context.
...\CurrentVersion\Run or \RunOnceRuns at sign-in. The most common persistence location in Windows. ...\Winlogon\Shell or \UserinitReplacing these hijacks the sign-in process itself. ...\Image File Execution Options\...\DebuggerHijacks the launch of another program, including accessibility tools on the lock screen. ...\Services\...\ImagePathChanges what a service actually runs. ...\Policies\Microsoft\Windows DefenderDisabling built-in protection. Most of the time it is one of these.
What gives it awayA value written to a Run or RunOnce key by a shell, a scripting engine, or a process in a temp directory rather than by an installer.
ATT&CK T1547.001What gives it awayModification of the Winlogon Shell or Userinit values, which are rarely changed legitimately.
ATT&CK T1547.004What gives it awayA Debugger value set for another program, which causes that program's launch to run something else instead.
ATT&CK T1546.012What gives it awayValues written under Windows Defender policy keys, or to security product configuration, by anything other than management tooling.
ATT&CK T1562.001What gives it awayModification of a service ImagePath value outside a software installation.
ATT&CK T1543.003Event | where Source == 'Microsoft-Windows-Sysmon' and EventID == 13 | where TargetObject has_any ('\\CurrentVersion\\Run','\\CurrentVersion\\RunOnce','\\Winlogon\\Shell','\\Winlogon\\Userinit','Image File Execution Options') | project TimeGenerated, Computer, Image, TargetObject, Details Event | where Source == 'Microsoft-Windows-Sysmon' and EventID == 13 | where TargetObject contains 'Windows Defender' or TargetObject contains 'DisableAntiSpyware' | project TimeGenerated, Computer, Image, TargetObject, Details detection:
selection:
EventID: 13
TargetObject|contains:
- '\\CurrentVersion\\Run\\'
- '\\CurrentVersion\\RunOnce\\'
filter:
Image|startswith: 'C:\\Program Files'
condition: selection and not filter They split registry activity by operation. Event 12 covers key creation and deletion, Event 13 covers a value being set, and Event 14 covers a key or value being renamed. Persistence is almost always written as a value, which is why Event 13 is the one most detection rules target.
Sysmon abbreviates hive names in its output, using HKLM, HKU, and similar. This trips up rules that match on the full hive name, so write your detection logic against the abbreviated form or match on the part of the path after the hive.
The Run and RunOnce keys in both HKLM and HKU, the Winlogon Shell and Userinit values, Image File Execution Options Debugger values, service ImagePath values, and your security product's configuration keys. Those cover the large majority of registry-based persistence at manageable volume.
Last reviewed 28 August 2026