Sysmon Internals
How Sysmon's driver captures kernel-level events, all 29 event types, config XML tuning, and the detection coverage every SOC should be measuring.
A Cobalt Strike beacon lands on a workstation via a malicious Office macro. It never touches disk with its shellcode — it injects directly into a running process. Windows Event Log shows a new process (4688) for winword.exe, then nothing. No network connection events. No file writes. But Sysmon Event 8 shows CreateRemoteThread from winword.exe into explorer.exe. Event 3 shows a network connection from explorer.exe to 185.234.x.x:443. Event 22 shows a DNS lookup for a domain registered three days ago. The native Windows logs told you nothing; Sysmon built the entire kill chain.
How Sysmon Works
Sysmon is a Windows system service and device driver that installs into the OS and persists across reboots. It operates at three levels:
Sysmon Architecture
══════════════════════════════════════════════════════════════════
User Mode Kernel Mode
───────── ───────────
┌───────────────────┐ ┌─────────────────────────┐
│ Sysmon.exe │ │ SysmonDrv.sys │
│ (service process)│ │ (kernel driver) │
│ │ IOCTL │ │
│ Reads config │◄──────────────│ Minifilter (FSFilter) │
│ Writes EVTX │ │ → file creates/renames │
│ via ETW │ │ │
└───────────────────┘ │ Kernel callbacks: │
│ PsSetCreateProcess │
ETW │ NotifyRoutine │
┌───────────────────┐ │ → process create/term │
│ Microsoft-Windows│◄──────────────│ │
│ -Sysmon ETW │ │ ObRegisterCallbacks │
│ Provider │ │ → process/thread handle│
└───────────────────┘ │ │
│ │ CmRegisterCallback │
▼ │ → registry operations │
┌────────────────────────────┐ │ │
│ Sysmon EVTX channel │ │ WFP callout (optional) │
│ (Operational) │ │ → network connections │
└────────────────────────────┘ └─────────────────────────┘
The driver intercepts operations at kernel level — before user-mode code can hide or tamper with them. This is why Sysmon sees injection techniques that native event logging misses.
All 29 Sysmon Event Types
| ID | Name | Captures | Detection Value |
|---|---|---|---|
| 1 | ProcessCreate | Process creation — hash, command line, parent, user, integrity level | ⭐⭐⭐⭐⭐ Core hunting event |
| 2 | FileCreationTimeChanged | Timestomping — file modify time changed by a process | ⭐⭐⭐ Anti-forensics detection |
| 3 | NetworkConnect | TCP/UDP connections with process, IP, port, hostname (DNS resolution) | ⭐⭐⭐⭐⭐ C2 beaconing detection |
| 4 | ServiceStateChanged | Sysmon service started/stopped | ⭐ Tamper detection only |
| 5 | ProcessTerminate | Process exit with PID | ⭐⭐ Short-lived process correlation |
| 6 | DriverLoad | Driver loaded — hash, signature status | ⭐⭐⭐⭐ BYOVD detection (unsigned drivers) |
| 7 | ImageLoad | DLL loaded into a process — hash, signature, path | ⭐⭐⭐⭐ DLL injection, reflective DLL |
| 8 | CreateRemoteThread | Cross-process thread creation — source/target PID, start address | ⭐⭐⭐⭐⭐ Process injection signature |
| 9 | RawAccessRead | Raw disk read bypassing filesystem (\\.\PhysicalDrive, \\.\C:) | ⭐⭐⭐ MBR access, disk forensics bypass |
| 10 | ProcessAccess | Process handle opened with specific access rights (e.g., PROCESS_VM_READ) | ⭐⭐⭐⭐⭐ LSASS dump detection |
| 11 | FileCreate | File created or overwritten — includes temp files, dropped payloads | ⭐⭐⭐⭐ Dropper detection |
| 12 | RegistryEventObjectCreateDelete | Registry key created or deleted | ⭐⭐⭐ Persistence via new keys |
| 13 | RegistryEventValueSet | Registry value set (DWORD/QWORD/binary/string) | ⭐⭐⭐⭐ RunKey persistence writes |
| 14 | RegistryEventKeyAndValueRename | Registry key or value renamed | ⭐⭐ Evasion via key rename |
| 15 | FileCreateStreamHash | NTFS Alternate Data Stream (ADS) creation + hash | ⭐⭐⭐ ADS-based payload storage |
| 16 | ServiceConfigurationChange | Sysmon configuration changed | ⭐ Tamper detection |
| 17 | PipeEventCreated | Named pipe server created | ⭐⭐⭐⭐ Cobalt Strike default pipe names |
| 18 | PipeEventConnected | Named pipe client connection | ⭐⭐⭐⭐ C2 pipe comms |
| 19 | WmiEventFilter | WMI __EventFilter created | ⭐⭐⭐⭐⭐ WMI persistence detection |
| 20 | WmiEventConsumer | WMI __EventConsumer created | ⭐⭐⭐⭐⭐ WMI persistence detection |
| 21 | WmiEventConsumerToFilter | WMI __FilterToConsumerBinding created | ⭐⭐⭐⭐⭐ WMI persistence detection |
| 22 | DNSEvent | DNS query from process — name, result, query type | ⭐⭐⭐⭐⭐ DGA, C2 domain detection |
| 23 | FileDelete | File deletion — optional archive of deleted file content | ⭐⭐⭐ Dropper cleanup detection |
| 24 | ClipboardChange | Clipboard content changes (enabled only in config) | ⭐⭐ Clipboard hijacking |
| 25 | ProcessTampering | Process image manipulation — hollowing, herpaderping detection | ⭐⭐⭐⭐⭐ Fileless malware hollowing |
| 26 | FileDeleteDetected | File delete detected (lighter than Event 23) | ⭐⭐⭐ Payload cleanup |
| 27 | FileBlockExecutable | Blocked executable file creation (rule-based blocking) | ⭐⭐⭐ Active blocking |
| 28 | FileBlockShredding | Blocked file shredding by a process | ⭐⭐⭐ Ransomware / anti-forensics |
| 29 | FileExecutableDetected | Executable file detected in monitored directory | ⭐⭐⭐ Dropper in monitored paths |
Configuration XML
Sysmon's power is in its config file. Without a config, Sysmon generates enormous noise (every DNS query, every network connection). A tuned config focuses on high-signal events and filters benign activity.
<Sysmon schemaversion="4.90">
<!-- Hash algorithm for file/process hashes -->
<HashAlgorithms>md5,sha256,imphash</HashAlgorithms>
<CheckRevocation/> <!-- Check driver cert revocation -->
<EventFiltering>
<!-- Event 1: Process Creation
onmatch="include" = only log matching events
onmatch="exclude" = log everything EXCEPT matches -->
<RuleGroup name="process_create" groupRelation="or">
<ProcessCreate onmatch="exclude">
<!-- Exclude noisy but benign processes -->
<Image condition="is">C:\Windows\System32\svchost.exe</Image>
<Image condition="is">C:\Windows\System32\taskhostw.exe</Image>
<Image condition="contains">antivirus</Image>
</ProcessCreate>
</RuleGroup>
<!-- Event 3: Network connections
Exclude common legitimate network traffic -->
<RuleGroup name="network_connect" groupRelation="or">
<NetworkConnect onmatch="exclude">
<Image condition="is">C:\Windows\System32\svchost.exe</Image>
<DestinationPort condition="is">53</DestinationPort>
<DestinationIp condition="is">127.0.0.1</DestinationIp>
</NetworkConnect>
</RuleGroup>
<!-- Event 8: CreateRemoteThread — INCLUDE specific suspicious targets -->
<RuleGroup name="remote_thread" groupRelation="or">
<CreateRemoteThread onmatch="include">
<!-- Injection into system processes is suspicious -->
<TargetImage condition="is">C:\Windows\System32\lsass.exe</TargetImage>
<TargetImage condition="is">C:\Windows\System32\csrss.exe</TargetImage>
<TargetImage condition="is">C:\Windows\explorer.exe</TargetImage>
<TargetImage condition="is">C:\Windows\System32\svchost.exe</TargetImage>
<StartFunction condition="is">LoadLibraryA</StartFunction>
<StartFunction condition="is">LoadLibraryW</StartFunction>
</CreateRemoteThread>
</RuleGroup>
<!-- Event 10: Process access (LSASS dumping detection) -->
<RuleGroup name="process_access" groupRelation="or">
<ProcessAccess onmatch="include">
<TargetImage condition="is">C:\Windows\System32\lsass.exe</TargetImage>
<GrantedAccess condition="is">0x1010</GrantedAccess> <!-- PROCESS_VM_READ + PROCESS_QUERY_INFO -->
<GrantedAccess condition="is">0x1410</GrantedAccess>
</ProcessAccess>
</RuleGroup>
<!-- Event 17/18: Pipe events (Cobalt Strike detection) -->
<RuleGroup name="pipe_events" groupRelation="or">
<PipeEvent onmatch="include">
<PipeName condition="contains">msagent_</PipeName>
<PipeName condition="contains">MSSE-</PipeName>
<PipeName condition="contains">postex_</PipeName>
<PipeName condition="contains">status_</PipeName>
<PipeName condition="contains">\svcctl</PipeName>
</PipeEvent>
</RuleGroup>
</EventFiltering>
</Sysmon>
Config Conditions Reference
| Condition | Behavior |
|---|---|
| is | Exact case-insensitive match |
| is not | Not exactly this value |
| contains | Substring match |
| contains all | All comma-separated values present |
| contains any | Any comma-separated value present |
| excludes | Does not contain substring |
| begin with | Starts with value |
| end with | Ends with value |
| less than | Numeric less than |
| greater than | Numeric greater than |
| image | Process image name only (not full path) |
MITRE ATT&CK Coverage Map
| ATT&CK Technique | Primary Sysmon Events | Key Fields |
|---|---|---|
| T1059 — Command Execution (PS/cmd) | 1 (ProcessCreate) | CommandLine, Image, ParentImage |
| T1055 — Process Injection | 8 (RemoteThread), 10 (ProcessAccess), 7 (ImageLoad) | SourceImage, TargetImage, GrantedAccess |
| T1053 — Scheduled Task | 1 (schtasks.exe), 13 (registry), 11 (task XML) | CommandLine with /create, task path in registry |
| T1547.001 — RunKey Persistence | 13 (RegistryValueSet) | TargetObject contains \Run\, Details |
| T1003.001 — LSASS Dump | 10 (ProcessAccess) | TargetImage=lsass.exe, GrantedAccess 0x1410 |
| T1071 — C2 over HTTP/S | 3 (NetworkConnect), 22 (DNS) | DestinationIp, DestinationPort, QueryName |
| T1140 — Deobfuscate/Decode | 1 (certutil -decode), 11 (output file) | CommandLine contains decode/deobfuscate |
| T1014 — Rootkit / Driver | 6 (DriverLoad) | Signed=false, ImageLoaded path |
| T1546.003 — WMI Persistence | 19, 20, 21 | Consumer, Filter, Binding objects |
| T1218 — LOLBin Execution | 1 (ProcessCreate) | Image=mshta.exe/wscript.exe/certutil.exe etc. |
| T1485 — Timestomping | 2 (FileCreationTimeChanged) | TargetFilename, CreationUtcTime vs PreviousCreation |
| T1071.004 — DNS C2 | 22 (DNSEvent) | QueryName (long/random subdomain), QueryStatus |
Sysmon Blind Spots
Treating Sysmon as a complete security solution. It closes many gaps that native Windows logging leaves open, but has its own blindspots that sophisticated attackers actively exploit.
| Blind Spot | Why Sysmon Misses It | Better Coverage |
|---|---|---|
| Direct syscalls bypassing ntdll | Sysmon hooks operate via ETW and kernel callbacks, but some coverage depends on user-mode hooks that direct syscalls bypass | EDR kernel sensor, ETW-TI |
| Encrypted shellcode in memory | Sysmon can't inspect memory content — it sees handles and network connections, not encrypted payloads | Memory scanning, behavioral EDR |
| WFP-bypassing network techniques (raw NDIS) | Event 3 uses WFP; NDIS-level manipulation bypasses WFP entirely | Network sensor / NDR |
| COM-based process creation (no direct CreateProcess) | ShellExecute via COM may not generate a standard process creation event chain visible in parent tracking | Sysmon Event 1 still captures the child |
| Very fast/short-lived processes (sub-millisecond) | Timing edge cases may miss rapid create/terminate | ETW process events have faster hooks |
| Sysmon driver unloading / service stop | Once the driver is unloaded, all coverage stops | Monitor Event 4 (Sysmon stopped) as an immediate alert |
| Reflective DLL without touching disk | Event 7 only fires when the DLL appears in the module list; some reflective loaders avoid this | Event 8 (RemoteThread) still fires |
Deployment and Tuning Strategy
Sysmon without tuning generates 500–2000 events per minute on a busy endpoint. With tuning (especially excluding noisy Events 3 and 13 for known-good processes), a well-configured endpoint generates 50–200 events/minute of high-signal data. The community Sysmon configuration by @SwiftOnSecurity or the Olaf Hartong modular config are good starting points.
Deployment at scale:
- Group Policy — copy Sysmon binary and config to SYSVOL, deploy as a startup script
- SCCM / Intune — package Sysmon as MSI or script via software deployment
- Ansible / Salt — manage via configuration management at scale
- Install:
sysmon64.exe -accepteula -i sysmon-config.xml - Update config without reinstall:
sysmon64.exe -c sysmon-config.xml - Verify install:
sysmon64.exe -s(print current schema version)
Q & A
Q: An attacker dumps LSASS using a custom tool that avoids MiniDumpWriteDump. Will Sysmon Event 10 still fire?
Yes, if the tool opens a handle to lsass.exe with read permissions. Event 10 fires on the handle open (OpenProcess API call) — it doesn't care which dump API is used afterward, or even if no standard API is used. The critical field is GrantedAccess — the attacker needs at minimum PROCESS_VM_READ (0x0010) and PROCESS_QUERY_INFORMATION (0x0400), giving 0x0410. Many custom tools use 0x1410 (adds PROCESS_VM_OPERATION). Alert on any non-lsass, non-system process opening lsass.exe with GrantedAccess containing 0x10.
Q: How do you detect process hollowing with Sysmon?
Sysmon Event 25 (ProcessTampering) is the dedicated event — it fires when Sysmon detects that a process's image on disk doesn't match what's mapped in memory (a classic sign of hollowing). Additionally: Event 8 (CreateRemoteThread) with start address in an unusual region, Event 10 (ProcessAccess with PROCESS_VM_WRITE access rights 0x20/0x28), and Event 1 where the parent-child relationship is suspicious (e.g., winword.exe spawning svchost.exe). Correlate all three for high confidence.
Q: What Sysmon events catch the three stages of Cobalt Strike's SMB pipe-based lateral movement?
Stage 1 — Service creation on target (PsExec-style): Sysmon Event 13 (registry write to Services key) + Event 1 (services.exe starting the new service). Stage 2 — Pipe comms: Sysmon Event 17 (pipe created by the service binary) + Event 18 (client connection). Default CS pipe names include MSSE-<4chars>-server, msagent_<hex>, status_<hex>. Stage 3 — Beacon execution: Event 8 (RemoteThread from the service into a host process) or Event 25 (process tampering if hollowing is used).
Q: Why does Sysmon's Event 3 (NetworkConnect) show DNS hostnames for some connections but not others?
Sysmon intercepts network connections at WFP callout level and attempts to resolve the destination IP back to a hostname using the Windows DNS cache. If the DNS query happened recently and is still cached, the hostname is resolved. If the connection is to an IP that was never DNS-queried (hardcoded IP in malware, or DNS was flushed), only the IP appears. This is why correlating Event 3 with Event 22 (DNSEvent, which captures the query before the connection) gives a more complete picture — the lookup happens before the connection, so the hostname is available in the DNS event even when it's not in the network event.