Sysmon Event ID 13: registry value set
What Sysmon Event ID 13 (registry value set) means, the fields to check, what is normal and what is suspicious, with PowerShell and KQL queries to find it.
Sysmon Event ID 13 is written when a registry value is set. The registry is where Windows keeps most of its autostart locations, so this is the event that catches persistence: a Run key pointing at a script in AppData, a hijacked debugger setting, a service path quietly rewritten. Like other Sysmon events it depends on your config, which should watch the keys below.
The fields that matter
| Field | What it tells you |
|---|---|
| EventType | SetValue for this event. |
| Image | The process that changed the value. |
| TargetObject | The full registry path, which says what kind of change it is. |
| Details | The new value: a path, a command line or a DWORD. |
What is normal
Installers and updaters writing their own keys, and familiar apps such as OneDrive and Teams adding themselves to the Run key.
When Sysmon Event ID 13 is suspicious
...\CurrentVersion\RunorRunOncepointing at Temp, AppData, PowerShell,mshtaor a script file.Winlogon\UserinitorWinlogon\Shellchanged from their defaults.- A
Debuggervalue underImage File Execution Options(for example onsethc.exeorutilman.exe). Services\<name>\ImagePathrewritten by something other than an installer.- New paths or processes under
Windows Defender\Exclusions. HKCU\Software\Classes\CLSID\...\InprocServer32added: COM hijacking.
Common false positive: Software installs and updates touch Run keys and service paths constantly. Signed installers from known vendors writing to their own entries are rarely a concern.
Find Sysmon Event ID 13 with PowerShell
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=13; StartTime=(Get-Date).AddDays(-7)} -MaxEvents 50 |
ForEach-Object {
$d = [ordered]@{ Time = $_.TimeCreated; Computer = $_.MachineName }
([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }
[pscustomobject]$d
} | Format-List
Microsoft Sentinel (KQL)
Event
| where TimeGenerated > ago(7d) and Source == "Microsoft-Windows-Sysmon" and EventID == 13
| project TimeGenerated, Computer, RenderedDescription, EventData
| order by TimeGenerated desc
Related events
- Sysmon Event ID 1: process creation
- System Event ID 7045: New service installed
- Event ID 4698: Scheduled task created
- Defender Event ID 5001: Defender real-time protection disabled
FAQ
What is the difference between Sysmon Event ID 12, 13 and 14?
12 is a key or value created or deleted, 13 a value set, 14 a key or value renamed. Persistence usually shows up as 13.
Which registry keys should I monitor?
At least the Run and RunOnce keys, Winlogon, Image File Execution Options, services and Defender exclusions. Community configs such as sysmon-modular include sensible lists.
Windows Event Triage reads a CSV, EVTX-to-JSON or XML export in your browser and flags brute force, new admins, suspicious services and log clearing.
IOC Triage, our free browser extension: right-click it for a verdict from 15 threat-intel sources, then copy a ready ticket note.