Skip to content
SOC Analyst Role
  • Loading index…

↑↓ navigate · ↵ open · Esc close

en

Sysmon · Persistence

Sysmon 13 · RegistryEvent (Value Set)

Sysmon Event ID 13 records registry value writes, including the key path, the new data and the process that wrote it. Because so much Windows persistence and defense evasion lives in the registry (Run keys, Winlogon, IFEO debuggers, Defender policy keys), it is a key source for spotting how malware survives reboots.

medium prioritySysmon logPersistenceMITRE T1547.001

Where it is logged

Microsoft-Windows-Sysmon/Operational on endpoints and servers. The config must include RegistryEvent rules for SetValue on the keys you care about (Run/RunOnce, Services, Winlogon, IFEO, Defender policies). Sysmon abbreviates hives as HKLM and HKU\<SID>.

Key fields to read

FieldWhat it tells you
EventTypeSetValue for value writes (Sysmon 12 covers key create/delete, 14 covers renames).
ImageProcess that wrote the value.
TargetObjectFull registry path including value name, e.g. HKU\S-1-5-21-...\Software\Microsoft\Windows\CurrentVersion\Run\OneDriveSync.
DetailsData written; for Run keys this is the command that will run at logon.
UserAccount context of the writing process (newer Sysmon versions).
ProcessGuidPivot to Sysmon 1 for how the writer was launched.

Sample event

Sysmon 13 — synthetic example
Log Name: Microsoft-Windows-Sysmon/Operational
EventID: 13
EventType: SetValue
UtcTime: 2026-11-19 10:28:01.552
Computer: NW-FIN-WS07.northwind.local
ProcessGuid: {4f1c2b7e-a2b2-6740-4105-000000002200}
Image: C:\Windows\System32\reg.exe
TargetObject: HKU\S-1-5-21-3623811015-3361044348-30300820-2290\Software\Microsoft\Windows\CurrentVersion\Run\OneDriveSync
Details: C:\Users\Public\Libraries\odsync.exe -k netsvc
User: NORTHWIND\l.brandt

How to triage it

  1. 1Classify TargetObject: Run/RunOnce, Winlogon\Shell/Userinit, Image File Execution Options\...\Debugger, Services ImagePath, or Defender policy keys.
  2. 2Read Details: does it point to a signed binary in Program Files, or to user-writable paths, scripts, rundll32 or encoded PowerShell?
  3. 3Check Image: installers and the legitimate application are expected; reg.exe, powershell.exe or an unknown binary writing persistence keys is suspicious.
  4. 4Pivot via ProcessGuid to Sysmon 1 to find the parent chain, then hash and analyze the referenced binary.
  5. 5Remove the persistence only after scoping, and search for the same value name or data across the fleet.

Benign vs suspicious

Usually benign

  • Applications registering auto-start entries during install (Teams, OneDrive, VPN clients).
  • Group Policy and management agents writing policy keys.
  • Windows and app updates modifying service ImagePath values.

Red flags

  • Run/RunOnce values pointing to C:\Users\Public, %APPDATA%, %TEMP% or to powershell -enc/mshta commands.
  • Image File Execution Options\<binary>\Debugger set (e.g. for sethc.exe or utilman.exe: accessibility backdoor).
  • Winlogon\Shell or Userinit modified to include an extra binary.
  • Defender policy keys such as DisableAntiSpyware, DisableRealtimeMonitoring or new Exclusions\Paths entries.
  • Value names imitating legitimate software (OneDriveSync, WindowsUpdate) with non-matching paths.

Hunt for it: Splunk & KQL

Splunk SPL
index=sysmon EventCode=13
  (TargetObject="*\\CurrentVersion\\Run*" OR TargetObject="*\\Image File Execution Options\\*\\Debugger" OR TargetObject="*\\Winlogon\\Shell" OR TargetObject="*\\Windows Defender\\Exclusions\\*")
| table _time, host, User, Image, TargetObject, Details
| sort - _time
Sentinel KQL
// Defender for Endpoint DeviceRegistryEvents: Run key persistence pointing to user-writable paths
DeviceRegistryEvents
| where Timestamp > ago(7d)
| where ActionType == "RegistryValueSet"
| where RegistryKey has @"\CurrentVersion\Run"
| where RegistryValueData has_any (@"\Users\Public\", @"\AppData\", @"\Temp\", "powershell", "mshta", "rundll32")
| project Timestamp, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine, RegistryKey, RegistryValueName, RegistryValueData

Field names depend on your add-on and table. More translations in the Splunk vs KQL cheat sheet.

Interview question

“Which registry locations would you monitor for persistence, and what event shows changes to them?”

✓ Strong answer sketch

Sysmon Event 13 (SetValue) shows writes, with TargetObject for the path and Details for the data. The classic locations are the Run and RunOnce keys under HKLM and each user's HKU hive, Winlogon Shell/Userinit, Image File Execution Options debugger values, and service ImagePath values. I would also monitor Defender policy and exclusion keys, because attackers often weaken AV before dropping payloads. For triage, the key question is whether Details points to a signed binary in a protected path or to something in a user-writable folder written by reg.exe or PowerShell.

More SOC interview questions

Frequently asked questions

What is the difference between Sysmon Event 12, 13 and 14?

12 logs registry key or value create/delete, 13 logs a value being set (with the data in Details), and 14 logs key or value renames.

Why does TargetObject start with HKU instead of HKCU?

HKCU is a per-session alias. Sysmon records the real hive path, HKU\<user SID>, which also tells you whose profile was modified.