Registry key or value created or deleted. EventType, TargetObject are key.
Registry-based persistence (Run keys, Services, COM objects). Defense evasion (deleting security tool registry keys). Credential access (modifying LSA security packages). TargetObject reveals the specific registry path being manipulated.
Alert: Run/RunOnce key modifications. Alert: HKLM\SYSTEM\CurrentControlSet\Services modifications. Alert: LSA security package changes (HKLM\SYSTEM\CurrentControlSet\Control\Lsa). Very high volume — focus on specific high-value paths.
ImageCommandLineParentImageUserHashes | Tactic | Technique |
|---|---|
| Persistence | Registry Run Keys (T1547.001) |
Starting points — adapt the log source, projected fields and thresholds for your environment.
Event
| where EventLog == "Microsoft-Windows-Sysmon/Operational" and EventID == 12 // Registry object added or deleted
// EventData holds: Image, CommandLine, ParentImage, User, Hashes
| project TimeGenerated, Computer, RenderedDescription
| sort by TimeGenerated desc
index=* sourcetype="WinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=12
| stats count earliest(_time) as first_seen latest(_time) as last_seen by ComputerName
| sort - count `# Registry object added or deleted — add EventData fields: Image, CommandLine, ParentImage, User`
Registry object added or deleted. Registry key or value created or deleted. EventType, TargetObject are key.
Event 12 is written to the Microsoft-Windows-Sysmon/Operational channel by Microsoft-Windows-Sysmon. Requires Sysmon installed with a config that logs this event (e.g. SwiftOnSecurity / Olaf Hartong).
Event 12 is associated with: Registry Run Keys (T1547.001).
Alert: Run/RunOnce key modifications. Alert: HKLM\SYSTEM\CurrentControlSet\Services modifications. Alert: LSA security package changes (HKLM\SYSTEM\CurrentControlSet\Control\Lsa). Very high volume — focus on specific high-value paths.