Snort and intrusion detection

Snort watches traffic and raises an alert when a rule matches. A rule is a hypothesis. An alert is a question for a person.

Lesson 8 of 26 · 12 min read · practice only with authorization

What is Snort?

Snort is a network intrusion-detection program. It raises an alert when traffic matches a rule you chose to care about. A rule is a hypothesis: this pattern is rare here, and when it is real it is worth a person. This page is about owning those alerts, not about triggering them on a network you do not run.

Who is affected when a Snort alert has no owner?

The people an incident reaches while the queue is noisy or empty: staff, customers, and the responder who hears about it from a ticket instead of from the sensor.

What do you change in a Snort deployment?

Write down what legitimate admin work looks like, or the rule will be muted. Send the alert to a place a person reads, and keep a copy of the log off the sensor. Practice by replaying a capture from a lab you own. A quiet console is not proof that nothing happened.

Diagram

From a rule to a decision a person can make

Follow the path. One example at a time.

Step 1 of 4

Hypothesis

This pattern is rare here, and the benign lookalike is written down.

Illustration: Hypothesis
# Hypothesis
# This pattern is rare here, and the benign lookalike is
# written down.

The example on the open step is one illustration, or the fix you can paste into an application you own.

Rules are hypotheses

An intrusion detection system sits where it can see traffic you care about: a span port, a tap, or a cloud mirror. Snort, Suricata, and Zeek are the usual names. A signature rule says “if you see this pattern, alert.” A behavioral rule says “if this volume or this sequence is rare, alert.” Both are wrong sometimes. The work is deciding which wrongness you can live with.

Write the hypothesis down. This pattern is rare on this network, and when it is real it is worth waking someone. Include the benign reason it might fire, or the on-call will mute the rule after the second false page.

Reading an alert

An alert should tell you the time, the sensor, the source, the destination, the rule name, and the packet or flow that matched. From there you ask whether the source was supposed to talk to the destination, whether the rule is known-noisy, and whether anything else happened to the same account or host in the same hour.

The alert is not the incident by itself. It is a pointer into the logs from the identity provider, the host, and the application. If those logs do not exist, the alert is a dead end, and the project is to create the log, not to add more signatures.

[1:2000001:1] LAB possible cleartext login
Source 10.10.10.10:51234  Destination 10.10.10.20:21
Time 09:14:02

Reading the sample

Something on the lab client talked to an FTP port on the lab server, and a rule written for cleartext login matched. FTP is a protocol that shows credentials to anyone who can see the segment. The control is to stop using it. The alert did its job if it sent you to that decision. Tuning the rule away while FTP stays in production is how the next capture becomes a breach report.

Practice by replaying a capture you made in your own lab into a local Snort or Suricata process, and confirm the rule you wrote fires once and only for that conversation. That is a complete exercise.

Check yourself

Recognition and the fix. Nothing here is a procedure.

1 / 3

A cleartext-login rule fires on lab FTP, and FTP is still allowed. What do you change?

Go deeper

Specific techniques, exercises, and glossary cards for this topic.

  1. 01Network traffic analysis: from packet capture to findings with Zeek and WiresharkHow to capture and analyze traffic for an investigation: where to capture, how to keep evidence intact, how Zeek turns pcaps into connection, DNS, and TLS logs, and a worked example that finds a beaconing host. Includes the diagram and a defensive fix.
  2. 02LOIC: what the Low Orbit Ion Cannon does and how defenders spot itLOIC is an old, simple flooding tool that sends TCP, UDP, or HTTP traffic from the user’s own IP. Includes the diagram and a defensive fix.
  3. 03hping3 in a lab: crafting TCP packets to see SYN floods and firewall behaviorhping3 builds custom TCP, UDP, and ICMP packets, which makes it a teaching tool for how SYN floods fill connection tables and how firewalls answer. Includes the diagram and a defensive fix.
  4. 04Denial of service and DDoS: volumetric, protocol, and application floodsThe three families of denial-of-service attack, what each exhausts (bandwidth, connection state, or application work), how botnets and reflection amplify them, and the layered defenses from upstream scrubbing to rate limits. Includes the diagram and a defensive fix.

Glossary

  1. 01Denial of serviceTraffic, expensive requests, or a fragile protocol state exhausts a service so legitimate users cannot use it.