Case: the SSH brute force
15 min · 1 ejercicio(s)
Tuesday night, 02:14 UTC. The monitoring of the web server srv-web-01 shows a burst of failed SSH logons. Your task as the on-call analyst: find out whether the attacker got in.
A typical brute-force investigation follows three steps:
- Scope: Which source is attacking, which accounts are targeted?
event.outcome: failure and service.name: ssh and host.name: srv-web-01 - Success? Did the same source log on successfully afterwards?
source.ip: <attacker> and event.outcome: success - Impact: What did the account do afterwards? (You will follow this trail with EQL later.)
Remember that KQL only filters. To see which IP is the loudest, look at the result table or use the field statistics in Kibana Discover. In the ES|QL track you will learn to aggregate this directly.
🔎 Profundiza: funciones, errores habituales y práctica
From filter to finding
A structured brute-force investigation in Kibana:
- Scope with KQL:
event.category: authentication and event.outcome: failure and host.name: srv-web-01 - Pivot on the attacker: click the
source.ipvalue in Discover and choose Filter for value. - Success check: change the outcome filter to
success. - Timeline: sort by
@timestampand note the first and last attempt and the first success. - Follow-up: what did the account do afterwards? (process events of
user.name: deployon the host, see the EQL track).
Typical patterns
| Pattern | Signal |
|---|---|
| Brute force | many failures for one account from one source |
| Password spraying (T1110.003) | few failures for many accounts, often from many sources |
| Credential stuffing (T1110.004) | many accounts, leaked passwords, often web logins |
| Success after failures | the critical one: a failure burst followed by a success from the same source |
Turning it into a detection
Elastic Security has a threshold rule type for "more than N events grouped by a field", and the prebuilt rules include brute-force detections. A KQL filter is the query part of such a rule; the counting is done by the rule engine.