Communitygithub.com

análisis-de-registros-de-eventos-de-windows-en-splunk

Analiza registros de eventos de seguridad, sistema y Sysmon de Windows en Splunk para detectar amenazas y construir líneas de tiempo forenses.

¿Qué es análisis-de-registros-de-eventos-de-windows-en-splunk?

Esta habilidad permite a analistas SOC, ingenieros de detección y respondedores de incidentes analizar registros de eventos de Windows (seguridad, sistema y Sysmon) directamente en Splunk. Proporciona flujos de trabajo detallados para detectar ataques de autenticación (fuerza bruta, password spray), escalada de privilegios (nuevas cuentas administrativas, manipulación de tokens), persistencia (tareas programadas, claves Run, suscripciones WMI) y movimiento lateral (SMB, PsExec, RDP). También incluye consultas para construir líneas de tiempo forenses integrales de un host comprometido y enriquecer el análisis con tablas de búsqueda de códigos de evento y técnicas ATT&CK. Soporta Splunk Enterprise con datos de Windows Event Log y Sysmon, asumiendo Windows Event Forwarding (WEF) y aceleración del modelo de datos CIM. Cada paso se basa en EventCodes específicos de Windows y EventCodes de Sysmon, con consultas SPL listas para usar que pueden integrarse en alertas, paneles o investigaciones ad-hoc.

Compatible con~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-windows-event-logs-in-splunk

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

Análisis de Registros de Eventos de Windows en Splunk

Cuándo Usarlo

Usa esta habilidad cuando:

  • Los analistas SOC investiguen alertas relacionadas con autenticación en Windows, ejecución de procesos o cambios en AD
  • Los ingenieros de detección construyan consultas SPL para la detección de amenazas basadas en Windows
  • Los respondedores de incidentes necesiten líneas de tiempo forenses de actividad en endpoints de Windows o controladores de dominio
  • La caza periódica de amenazas se dirija a técnicas ATT&CK específicas de Windows

No usar para análisis de endpoints Linux/macOS o investigaciones solo de red.

Prerrequisitos

  • Splunk con datos de registros de eventos de Windows ingeridos (sourcetype WinEventLog:Security, WinEventLog:System, XmlWinEventLog:Microsoft-Windows-Sysmon/Operational)
  • Sysmon desplegado en endpoints con configuración SwiftOnSecurity u Olaf Hartong
  • Aceleración del modelo de datos CIM para los modelos de datos Endpoint y Authentication
  • Conocimiento de los IDs de eventos de seguridad de Windows y tipos de eventos de Sysmon

Flujo de Trabajo

Paso 1: Detección de Ataques de Autenticación

Detección de Fuerza Bruta (EventCode 4625 — Inicio de Sesión Fallido):

index=wineventlog sourcetype="WinEventLog:Security" EventCode=4625
| stats count, dc(TargetUserName) AS unique_users, values(TargetUserName) AS targeted_users
  by src_ip, Logon_Type, Status
| where count > 20
| eval attack_type = case(
    Logon_Type=3, "Fuerza Bruta de Red",
    Logon_Type=10, "Fuerza Bruta RDP",
    Logon_Type=2, "Fuerza Bruta Interactiva",
    1=1, "Otro"
  )
| eval status_meaning = case(
    Status="0xc000006d", "Usuario o Contraseña Incorrectos",
    Status="0xc000006a", "Contraseña Incorrecta (usuario válido)",
    Status="0xc0000234", "Cuenta Bloqueada",
    Status="0xc0000072", "Cuenta Deshabilitada",
    1=1, Status
  )
| sort - count
| table src_ip, attack_type, status_meaning, count, unique_users, targeted_users

Detección de Password Spray:

index=wineventlog sourcetype="WinEventLog:Security" EventCode=4625 Logon_Type=3
| bin _time span=10m
| stats dc(TargetUserName) AS unique_users, count AS total_attempts,
  values(TargetUserName) AS users_targeted by src_ip, _time
| where unique_users > 10 AND total_attempts < unique_users * 3
| eval spray_confidence = if(unique_users > 25, "ALTA", "MEDIA")

Inicio de Sesión Exitoso Después de Fallos (Indicador de Compromiso):

index=wineventlog sourcetype="WinEventLog:Security"
(EventCode=4625 OR EventCode=4624) src_ip!="127.0.0.1"
| sort _time
| stats earliest(_time) AS first_seen, latest(_time) AS last_seen,
  sum(eval(if(EventCode=4625,1,0))) AS failures,
  sum(eval(if(EventCode=4624,1,0))) AS successes
  by src_ip, TargetUserName, ComputerName
| where failures > 10 AND successes > 0
| eval time_to_success = round((last_seen - first_seen)/60, 1)
| sort - failures

Paso 2: Detección de Escalada de Privilegios

Nueva Cuenta de Administrador Creada (T1136.001):

index=wineventlog sourcetype="WinEventLog:Security" EventCode=4720
| join TargetUserName type=left [
    search index=wineventlog EventCode=4732 TargetUserName="Administrators"
    | rename MemberName AS TargetUserName
  ]
| table _time, SubjectUserName, TargetUserName, ComputerName
| eval alert = "Nueva cuenta creada y añadida al grupo Administradores"

Privilegios Especiales Asignados (EventCode 4672):

index=wineventlog sourcetype="WinEventLog:Security" EventCode=4672
SubjectUserName!="SYSTEM" SubjectUserName!="LOCAL SERVICE" SubjectUserName!="NETWORK SERVICE"
| stats count, values(PrivilegeList) AS privileges by SubjectUserName, ComputerName
| where count > 0
| search privileges IN ("SeDebugPrivilege", "SeTcbPrivilege", "SeBackupPrivilege",
  "SeRestorePrivilege", "SeAssignPrimaryTokenPrivilege")

Detección de Manipulación de Tokens (T1134):

index=sysmon EventCode=10 TargetImage="*\\lsass.exe"
GrantedAccess IN ("0x1010", "0x1038", "0x1fffff", "0x40")
| stats count by SourceImage, SourceUser, Computer, GrantedAccess
| where NOT match(SourceImage, "(svchost|csrss|wininit|MsMpEng|CrowdStrike)")
| sort - count

Paso 3: Detección de Mecanismos de Persistencia

Creación de Tareas Programadas (T1053.005):

index=wineventlog (sourcetype="WinEventLog:Security" EventCode=4698)
  OR (sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
      Image="*\\schtasks.exe")
| eval task_info = coalesce(TaskContent, CommandLine)
| search task_info="*powershell*" OR task_info="*cmd*" OR task_info="*http*" OR task_info="*\\Temp\\*"
| table _time, Computer, SubjectUserName, TaskName, task_info

Modificación de Claves Run del Registro (T1547.001):

index=sysmon EventCode=13
TargetObject IN (
  "*\\CurrentVersion\\Run\\*",
  "*\\CurrentVersion\\RunOnce\\*",
  "*\\CurrentVersion\\RunServices\\*",
  "*\\Explorer\\Shell Folders\\*"
)
| stats count by Computer, Image, TargetObject, Details
| where NOT match(Image, "(explorer\\.exe|msiexec\\.exe|setup\\.exe)")
| sort - count

Suscripción a Eventos WMI (T1546.003):

index=sysmon EventCode=20 OR EventCode=21
| stats count by Computer, Operation, Consumer, EventNamespace
| where count > 0

Paso 4: Detección de Movimiento Lateral

Explotación de Servicio Remoto (T1021.002 — SMB/Recursos Administrativos de Windows):

index=wineventlog sourcetype="WinEventLog:Security" EventCode=4624 Logon_Type=3
| stats dc(ComputerName) AS unique_destinations, values(ComputerName) AS targets
  by src_ip, TargetUserName
| where unique_destinations > 3
| sort - unique_destinations
| table src_ip, TargetUserName, unique_destinations, targets

Detección de PsExec (T1021.002):

index=sysmon EventCode=1
(Image="*\\psexec.exe" OR Image="*\\psexesvc.exe"
 OR ParentImage="*\\psexesvc.exe"
 OR OriginalFileName="psexec.c")
| table _time, Computer, User, ParentImage, Image, CommandLine

Movimiento Lateral por RDP (T1021.001):

index=wineventlog sourcetype="WinEventLog:Security" EventCode=4624 Logon_Type=10
| stats count, dc(ComputerName) AS rdp_targets, values(ComputerName) AS destinations
  by src_ip, TargetUserName
| where rdp_targets > 2
| sort - rdp_targets

Paso 5: Construir Línea de Tiempo Forense

Crea una línea de tiempo completa para un host comprometido:

(index=wineventlog OR index=sysmon) Computer="WORKSTATION-042"
earliest="2024-03-14T00:00:00" latest="2024-03-16T00:00:00"
| eval event_description = case(
    EventCode=4624, "Inicio de Sesión: ".TargetUserName." (Tipo ".Logon_Type.")",
    EventCode=4625, "Inicio de Sesión Fallido: ".TargetUserName,
    EventCode=4688 OR (sourcetype="XmlWinEventLog:*Sysmon*" AND EventCode=1),
      "Proceso: ".Image." CMD: ".CommandLine,
    EventCode=4698, "Tarea Programada: ".TaskName,
    EventCode=3, "Red: ".DestinationIp.":".DestinationPort,
    EventCode=11, "Archivo Creado: ".TargetFilename,
    EventCode=13, "Registro: ".TargetObject,
    1=1, "Evento ".EventCode
  )
| sort _time
| table _time, EventCode, event_description, User, src_ip

Paso 6: Crear Tablas de Búsqueda para Enriquecimiento

Construye referencias de búsqueda para contexto de Event ID de Windows:

| inputlookup windows_eventcode_lookup.csv
| table EventCode, Description, ATT_CK_Technique, Severity

Si la búsqueda no existe, créala:

EventCode,Description,ATT_CK_Technique,Severity
4624,Inicio de Sesión Exitoso,T1078,Informativo
4625,Inicio de Sesión Fallido,T1110,Bajo
4648,Inicio de Sesión con Credencial Explícita,T1078,Medio
4672,Privilegios Especiales Asignados,T1134,Medio
4688,Nuevo Proceso Creado,T1059,Informativo
4698,Tarea Programada Creada,T1053.005,Medio
4720,Cuenta de Usuario Creada,T1136.001,Alto
4732,Miembro Añadido a Grupo de Seguridad,T1098,Alto
4768,Solicitud de TGT Kerberos,T1558,Informativo
4769,Boleto de Servicio Kerberos,T1558.003,Bajo
4771,Pre-Autenticación Kerberos Fallida,T1110,Bajo

Conceptos Clave

TérminoDefinición
EventCode 4624Evento de inicio de sesión exitoso — Logon_Type 2 (interactivo), 3 (red), 10 (RDP), 7 (desbloqueo)
EventCode 4625Evento de inicio de sesión fallido — El código de estado indica el motivo del fallo (contraseña incorrecta, cuenta bloqueada, deshabilitada)
Sysmon EventCode 1Creación de proceso con línea de comandos completa, proceso padre e información de hash
Sysmon EventCode 3Conexión de red iniciada por un proceso — IP origen/destino, puerto y contexto del proceso
Logon Type 3Inicio de sesión de red (SMB, WMI, PowerShell Remoting) — indicador clave de movimiento lateral
Logon Type 10Inicio de sesión remoto interactivo a través de RDP/Servicios de Terminal

Herramientas y Sistemas

  • Splunk Enterprise: Plataforma SIEM con motor de consultas SPL para análisis y correlación de registros de eventos de Windows |
  • Sysmon (Monitor del Sistema): Herramienta de Microsoft Sysinternals que proporciona registro detallado de procesos, red y actividad de archivos
  • Splunk CIM: Modelo de Información Común que mapea eventos de Windows a campos normalizados para consultas entre fuentes
  • Reenvío de Eventos de Windows (WEF): Mecanismo integrado de Windows para centralizar registros de eventos en un servidor colector

Escenarios Comunes

  • Kerberoasting (T1558.003): Detectar EventCode 4769 con tipo de cifrado 0x17 (RC4) para cuentas de servicio no estándar
  • DCSync (T1003.006): Detectar EventCode 4662 con DS-Replication-Get-Changes desde fuentes que no son controladores de dominio
  • Golden Ticket (T1558.001): Detectar EventCode 4769 con propiedades de ticket anómalas (vida útil larga, cifrado no estándar)
  • Pass-the-Hash (T1550.002): Detectar EventCode 4624 Logon_Type 3 con autenticación NTLM desde fuentes inesperadas
  • DLL Side-Loading (T1574.002): Sysmon EventCode 7 que muestra DLLs sin firmar cargadas por procesos legítimos

Formato de Salida

ANÁLISIS DE REGISTROS DE EVENTOS DE WINDOWS — HOST: WORKSTATION-042
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Período:     2024-03-14 a 2024-03-15
Eventos:     12,847 total (Seguridad: 9,231 | Sysmon: 3,616)

Resumen de Autenticación:
  Inicios de Sesión Exitosos (4624):    487 (Tipo 3: 312, Tipo 10: 45, Tipo 2: 130)
  Inicios de Sesión Fallidos (4625):    847 (desde 192.168.1.105 — FUERZA BRUTA)
  Credenciales Explícitas (4648):       12

Hallazgos Sospechosos:
  [ALTO]   847 inicios de sesión fallidos seguidos de éxito a las 14:35 desde 192.168.1.105
  [ALTO]   Nuevo usuario "backdoor_admin" creado (4720) a las 14:38
  [ALTO]   Usuario añadido al grupo Administradores (4732) a las 14:38
  [MEDIO]  schtasks.exe creando tarea de persistencia a las 14:42
  [MEDIO]  Ejecución de comando PowerShell codificado a las 14:45

Mapeo ATT&CK:
  T1110.001 — Adivinación de Contraseñas (847 inicios de sesión fallidos)
  T1136.001 — Creación de Cuenta Local (backdoor_admin)
  T1053.005 — Tarea Programada (persistencia)
  T1059.001 — PowerShell (ejecución codificada)

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

abusing-dpapi-for-credential-access

Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using SharpDPAPI, SharpChrome, Mimikatz, or Impacket

abusing-shadow-credentials-for-privesc

Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or Certipy, then authenticate via PKINIT to recover the target

achieving-cmmc-level-2-compliance

>-

acquiring-disk-image-with-dd-and-dcfldd

Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification (MD5/SHA) during acquisition. Use when imaging a suspect drive, USB device, or memory card for investigation, preserving volatile disk evidence during incident response, or producing a verified copy for legal or law-enforcement proceedings before any destructive analysis.

analyzing-active-directory-acl-abuse

Detect dangerous ACL misconfigurations in Active Directory using ldap3

analyzing-android-malware-with-apktool

Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection, dangerous permission-combination detection, and identification of obfuscated code, dynamic code loading, and reflection-based API calls. Use to statically triage a suspicious APK without executing it or to build mobile malware detection rules.

analyzing-api-gateway-access-logs

Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect

analyzing-apt-group-with-mitre-navigator

Query ATT&CK data with attackcti, mitreattack-python, and stix2, then build MITRE ATT&CK Navigator layers and multi-layer heatmap overlays mapping one or more APT groups

analyzing-azure-activity-logs-for-threats

Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query

analyzing-bootkit-and-rootkit-samples

Analyzes bootkit and advanced rootkit malware infecting the Master

analyzing-browser-forensics-with-hindsight

Parse Chromium-based browser databases with Hindsight to extract and correlate browsing history, downloads, cookies, cached content, autofill data, saved passwords, and extensions from Chrome, Edge, Brave, Opera, and Vivaldi into a unified timeline (XLSX, JSON, or SQLite output). Use during incident response, insider-threat investigations, or criminal cases when you need to reconstruct a user

analyzing-campaign-attribution-evidence

Systematically evaluate cyber-campaign evidence to attribute an operation to a threat actor, using the Diamond Model and Analysis of Competing Hypotheses (ACH) to weigh infrastructure overlaps, TTP consistency, malware code similarity, and timing/language artifacts into confidence-weighted attribution assessments. Use when an incident investigation needs a defensible attribution confidence level.

analyzing-certificate-transparency-for-phishing

Monitor Certificate Transparency logs using crt.sh and Certstream to

analyzing-cloud-storage-access-patterns

Detect abnormal access in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics for after-hours bulk downloads, new-IP access, and API-call spikes (e.g. GetObject) via statistical baselines and time-series anomaly detection. Use when investigating suspected cloud data exfiltration or building related detection rules.

analyzing-cobalt-strike-beacon-configuration

Extract and analyze Cobalt Strike beacon configuration from PE files

analyzing-cobaltstrike-malleable-c2-profiles

Parse and analyze Cobalt Strike Malleable C2 profiles with dissect.cobaltstrike (profiles and beacon-payload configs) and pyMalleableC2 (AST parsing) to extract HTTP/DNS transforms, URIs, headers, sleep/jitter, and injection behavior, then generate network detection signatures. Use when reverse-engineering a captured malleable profile or building detections against Cobalt Strike Beacon traffic.

analyzing-command-and-control-communication

Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom

analyzing-cyber-kill-chain

Analyzes intrusion activity against the Lockheed Martin Cyber Kill Chain

analyzing-disk-image-with-autopsy

Perform comprehensive forensic analysis of raw (dd), E01, or AFF disk images with Autopsy and The Sleuth Kit, recovering deleted files, examining metadata and embedded artifacts, keyword searching, and building investigation timelines with visual reports. Use for structured analysis of a forensic disk image or when stakeholders need visual reports from evidence.

analyzing-dns-logs-for-exfiltration

Analyzes DNS query logs to detect data exfiltration via DNS tunneling,

Skills relacionados