Sysmon (Sysinternals System Monitor) extiende el registro nativo de Windows con telemetría de alto valor para detección y respuesta: creación de procesos, conexiones de red, acceso entre procesos, carga de DLL, consultas DNS, y más. Bien configurado, convierte el “ruido” del endpoint en señales diferenciadas que tu SIEM/Lake puede operar con reglas, ML o cazas guiadas.
Canal, proveedor y eventos útiles
Canal: Microsoft-Windows-Sysmon/Operational · Proveedor: Microsoft-Windows-Sysmon. IDs clave: 1(Process Create), 3 (NetworkConnect), 7 (ImageLoaded), 8 (CreateRemoteThread), 10 (ProcessAccess), 11(FileCreate), 12/13 (Registry), 15 (FileCreateStreamHash), 16 (ConfigChange), 22 (DNS Query). Con estos cubres la mayoría de TTPs sin desbordar volumen.
Instalación y ciclo de vida
# instalar con configuración
.sysmon64.exe -accepteula -i .sysmonconfig.xml
# actualizar configuración sin reiniciar el servicio
.sysmon64.exe -c .sysmonconfig.xml
# desinstalar (cuidado: elimina el driver/servicio)
.sysmon64.exe -uAsegura persistencia del binario/config en una ruta de solo-lectura para usuarios estándar y controla drift con gestión de configuración (Intune, GPO, Chef, etc.).
Configuración mínima eficaz (XML)
Activa lo que da señal, filtra lo obvio, y fija algoritmos de hash. Ejemplo simplificado:
<Sysmon schemaversion="4.82">
<HashAlgorithms>sha256,imphash</HashAlgorithms>
<EventFiltering>
<ProcessCreate onmatch="include">
<Image condition="end with">\powershell.exe</Image>
<Image condition="end with">\cmd.exe</Image>
<Image condition="end with">\wscript.exe</Image>
<Image condition="end with">\mshta.exe</Image>
<ParentImage condition="end with">\WINWORD.EXE</ParentImage>
<CommandLine condition="contains">-enc</CommandLine>
</ProcessCreate>
<ImageLoad onmatch="include">
<ImageLoaded condition="contains">\AppData\</ImageLoaded>
<ImageLoaded condition="contains">\Temp\</ImageLoaded>
<Signed condition="is">false</Signed>
</ImageLoad>
<NetworkConnect onmatch="include">
<Image condition="end with">\powershell.exe</Image>
<Image condition="end with">\rundll32.exe</Image>
<DestinationPort condition="is not">443</DestinationPort>
</NetworkConnect>
<DnsQuery onmatch="include">
<Image condition="end with">\powershell.exe</Image>
<QueryName condition="ends with">.onion</QueryName>
<QueryName condition="contains">.</QueryName>
</DnsQuery>
<RuleGroup name="Suppress - Ruido conocido" groupRelation="or">
<ProcessCreate onmatch="exclude">
<Image condition="begin with">C:\Windows\System32\</Image>
</ProcessCreate>
<NetworkConnect onmatch="exclude">
<Image condition="end with">\chrome.exe</Image>
<Image condition="end with">\msedge.exe</Image>
</NetworkConnect>
</RuleGroup>
</EventFiltering>
</Sysmon>Ajusta supresiones por aplicación (navegadores, agentes EDR, actualizadores) para reducir falsos positivos.
Ingesta al SIEM/Lake
# Winlogbeat (Elastic) - ejemplo mínimo
winlogbeat.event_logs:
- name: Microsoft-Windows-Sysmon/Operational
ignore_older: 72h
processors:
- add_fields:
target: event.module
fields: { sysmon: true }# AMA/Agents a Log Analytics (Azure)
# En KQL verás registros en 'Event' o 'WindowsEvent'
# con Provider == "Microsoft-Windows-Sysmon".Normaliza a un esquema común (ECS/OSSEM) para queries portables entre proveedores.
Consultas prácticas (local y SIEM)
PowerShell (local)
# últimos 500 eventos de Sysmon
Get-WinEvent -LogName "Microsoft-Windows-Sysmon/Operational" -MaxEvents 500 |
Select-Object TimeCreated, Id, ProviderName, Message
# procesos lanzados por Office - EventID 1
Get-WinEvent -FilterHashtable @{
LogName = "Microsoft-Windows-Sysmon/Operational"; Id = 1
} | Where-Object { $_.Message -match "ParentImage.*WINWORD.EXE" } |
Select TimeCreated, Id, MessageKQL (Azure Log Analytics)
// Sysmon por proveedor
Event
| where Provider == "Microsoft-Windows-Sysmon"
// Procesos sospechosos: Office -> Scripting
| where EventID == 1
| where tostring(parse_xml(RenderedDescription).Event.EventData.Data[?(@.Name=="ParentImage")].'#text') endswith "WINWORD.EXE"
| where tostring(parse_xml(RenderedDescription).Event.EventData.Data[?(@.Name=="Image")].'#text') matches regex "(powershell|wscript|cscript|mshta)\.exe$"
| project TimeGenerated, Computer, EventID,
Image = tostring(parse_xml(RenderedDescription).Event.EventData.Data[?(@.Name=="Image")].'#text'),
CommandLine = tostring(parse_xml(RenderedDescription).Event.EventData.Data[?(@.Name=="CommandLine")].'#text')Splunk (SPL)
index=win (sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" OR source="WinEventLog:Microsoft-Windows-Sysmon/Operational")
EventCode=1 ParentImage="*\WINWORD.EXE" Image="*\powershell.exe" |
table _time host Image CommandLine ParentImage ParentCommandLineSigma (regla portable)
title: Office spawning scripting engines
logsource:
product: windows
service: sysmon
detection:
selection:
EventID: 1
ParentImage|endswith:
- \WINWORD.EXE
- \EXCEL.EXE
Image|endswith:
- \powershell.exe
- \wscript.exe
condition: selection
level: high
tags: [ attack.t1059.001, attack.t1204 ]Casos de uso con alta señal
- Cadena padre-hijo anómala: Office → PowerShell/cmd/mshta (ID 1).
- DLL en rutas temporales: carga desde
%AppData%/%Temp%(ID 7) y no firmada. - Acceso entre procesos:
ProcessAccessa LSASS o a navegadores (ID 10). - CreateRemoteThread: inyección clásica entre procesos (ID 8).
- DNS sospechoso: dominios con longitud/entropía altas o
.onion(ID 22). - Conexiones salientes inusuales: binarios del sistema iniciando conexiones a puertos no estándar (ID 3).
Rendimiento y calidad del dato
- Filtra temprano: usa
excludepara agentes/softwares ruidosos. - Hashing selectivo:
sha256es suficiente en la mayoría; evitamd5si no lo necesitas. - Volumen DNS: el ID 22 crece rápido; limítalo por proceso y dominios.
- Validación: compara contra un corpus limpio y otro malicioso; mide FP/FN y latencia de ingesta.
Pruebas rápidas
# generar eventos 1 y 3
Start-Process -FilePath "powershell.exe" -ArgumentList "-NoP -W Hidden -c ping 1.1.1.1"
# ver últimos eventos de Sysmon con formato
Get-WinEvent -LogName "Microsoft-Windows-Sysmon/Operational" -MaxEvents 50 |
Format-List -Property *Sysmon no es “más logs”: es mejor telemetría. Con configuración deliberada, consultas reproducibles y reglas portables (Sigma), podrás detectar TTPs reales con menos ruido y más contexto para responder con precisión.



