Iniciar sesión

Practice: event queries

12 min · 2 ejercicio(s)

Cheat sheet

Syntax Meaning
process where … Only events with event.category = process
any where … Any category
==, != Case-sensitive comparison
: Case-insensitive, supports * and ? wildcards
in ("a", "b") One of several values (case-sensitive), in~ ignores case
and, or, not Boolean logic
cidrMatch(ip, "10.0.0.0/8") IP in network
length(s), startsWith(s, "x"), endsWith String functions
| head 5, | tail 5 Pipes that limit results

== or :?

Process names are a classic trap: Windows shows PowerShell.exe, powershell.EXE or POWERSHELL.EXE depending on how it was started. Detections should use process.name : "powershell.exe" (case-insensitive). Use == when you need exact matching, for example on hashes or IDs.

Arrays

ECS fields like process.args are arrays. process.args == "cl" is true if any element equals cl. That is perfect to find a flag regardless of its position in the command line.

Ejercicios prácticos de esta lección

Resuelve estos ejercicios con una consulta en el laboratorio Elasticsearch real. Inicia sesión gratis para acceder al laboratorio, las pistas y la corrección automática.

  1. 1. Deleted files

    How many file deletion events (event.type == "deletion") are in lab-endpoint?

  2. 2. Weaponized files

    Return all file events whose extension is dmp or docm. Graded by result.