Theory · 8 min · Network monitoring
IDS and IPS rules
Read a Suricata or Snort rule and know what an alert from it means.
An intrusion detection system (IDS) matches traffic against signatures and alerts; an intrusion prevention system (IPS) can also drop it. Suricata and Snort share a similar rule language.
A rule has an action (alert, drop, pass), a header (protocol, source, direction, destination and ports) and options in brackets: msg (the alert text), content (bytes to match), flow, sid (the rule ID) and rev.
Content matches look in a buffer. http.uri is the normalised URI: the engine has already decoded it and removed ../ segments, so a traversal never appears there. Rules that hunt traversal or encoding tricks match the raw buffer, http.uri.raw, which keeps the URI exactly as the client sent it.
An IDS alert means the traffic matched, not that the attack worked. Check the response: a 404 or a reset says the exploit probably failed; a 200 with a large response, or follow-up connections from the target, says look harder.
Watch the mode. A sensor in monitor (IDS) mode alerts but blocks nothing, so "the IPS saw it" does not mean "the IPS stopped it".
Your turn: select the field that proves it. Select the part of the rule that decides which bytes in the traffic it matches.
Do the interactive check Free, in the browser.