Operator On The Wire
Join
← Back to Knowledge Base
BLUE TEAM / THREAT HUNT / WINDOWS / PERSISTENCE

Registry Run Keys

This note documents detection patterns related to Registry Run Keys within Windows environments.


Direct Indicators

LogEvent IDMeaningForensic ValueNotes
Sysmon13Registry value setCriticalPrimary detection point for Run / RunOnce persistence creation. Review target key, value name, payload path, user context.
Sysmon12Registry object create/deleteHighUseful when keys are newly created or removed.
Security4657Registry value modifiedHighNative registry auditing if enabled.
Sysmon1Process creationCriticalHunt for reg.exe, powershell.exe, cmd.exe, mshta.exe writing Run keys.
Security4688Process creationHighUseful for command-line correlation.
Sysmon11File createMediumPayload often written immediately before persistence.
PowerShell4104Script block loggingCriticalCaptures New-ItemProperty / Set-ItemProperty activity.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Run key payload in temp pathAppData, Temp, PublicCriticalStrong malicious signal
Encoded PowerShellbase64 in registry valueCriticalCommon stealth persistence
Non-standard autorun locationHKCU used by unexpected accountHighUseful for low-privilege persistence
Delayed execution after logonPayload triggers at user logonHighCorrelate with 4624

Common Tools

ToolUsage
reg.exeNative registry persistence
PowerShellSet-ItemProperty / New-ItemProperty
Cobalt StrikeRegistry autorun persistence
EmpireRegistry persistence modules
SharpPersistCommon red team persistence

Relevant Artifacts

  • HKCU\Software\Microsoft\Windows\CurrentVersion\Run
  • HKLM\Software\Microsoft\Windows\CurrentVersion\Run
  • RunOnce keys
  • Sysmon 12/13
  • Security 4657
  • Prefetch for reg.exe / powershell.exe
  • Amcache / ShimCache
  • MFT / USN for payload drop

MITRE ATT&CK References

  • T1547.001 Registry Run Keys / Startup Folder

Decision Tree

  1. Was Run key created?
  2. What process wrote it?
  3. What payload executes?
  4. Is payload signed / expected?
  5. Did execution occur after logon?

Example Detection Templates

KQL

Sysmon
| where EventID == 13
| where TargetObject has @"\CurrentVersion\Run"

Sigma

title: Registry Run Key Persistence
logsource:
  product: windows
  service: sysmon
detection:
  selection:
    EventID: 13
  condition: selection

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
Autorun monitoringAlert on Run keysCriticalCore coverage
PowerShell loggingEnable 4104HighScript visibility