Network intrusion detection with Snort in fast networks
Summary
At Chemnitzer Linux-Tage 2003, Edin Dizdarevic showed how the free network intrusion detection system Snort works and how to run it reliably in fast networks. Snort reads network traffic, compares it with rules for known attack patterns and reports matches as alerts. The core message of the talk was “less is more”: a few well-chosen rules and preprocessors instead of every available feature.
What is Snort?
Snort is a network intrusion detection system, NIDS for short. Martin Roesch released it in 1998 as free software under the GPL. Snort builds on libpcap, so like tcpdump it reads the packets on a network interface, and it can run in three modes: as a plain packet sniffer, as a packet logger and as a detection system.
In detection mode Snort checks every packet against rules. A rule describes protocol, addresses and ports plus typical characteristics of an attack, such as a particular byte sequence in the payload. Preprocessors first reassemble fragmented packets and TCP streams so that attacks cannot simply be split across several packets.
Why do we need it?
A firewall decides which connections are allowed. It does not see what happens inside an allowed connection. A NIDS looks exactly there: it notices when a known exploit runs over an open web port, when a machine on the network starts scanning, or when an internal server suddenly talks to the outside world.
In 2003 this was particularly topical. Worms such as Code Red and Nimda had infected thousands of servers in 2001, and in January 2003 SQL Slammer crippled parts of the internet within minutes. Anyone who wanted to know whether their own network was affected needed visibility of the traffic.
What the talk added
Installing Snort is easy; running it sensibly is not. The talk went through the phases of planning, compiling, rule optimisation and storing alerts: where does the sensor sit, which network counts as your own, which preprocessors and rules do you really need?
In fast networks every additional rule costs computing time. If the sensor is overloaded, it drops packets, and that is exactly where the attack may be. Too many rules also produce false alarms that hide real hits. The test results presented in the talk therefore supported a lean configuration.
Ideas
- A NIDS complements the firewall by checking the content of allowed connections.
- Rules describe known attack patterns by protocol, ports and content.
- Preprocessors reassemble fragments and TCP streams before inspection.
- The position of the sensor determines which traffic it sees at all.
Insights
- An overloaded sensor drops packets and with them exactly the attacks it is supposed to find.
- False alarms are not a cosmetic flaw: they make real hits invisible.
- Signature-based detection reliably finds known attacks, but new ones only with maintained rules.
Facts
- Snort appeared in 1998, developed by Martin Roesch, as free software under the GPL.
- In 2001 Roesch founded Sourcefire, which developed Snort further and built commercial products on it.
- Snort 2.0 was released in 2003 with a reworked, faster detection engine.
- The talk took place on the Sunday in the security track of Chemnitzer Linux-Tage 2003.
References
Remarks
- Cisco acquired Sourcefire in 2013; Snort 3 was released in 2021 with a new architecture. Suricata later established itself as a free alternative that understands rules in Snort format and uses several CPU cores.
- This post previously carried the loosely paraphrased title “Detecting network attacks with Snort”; it now gives the actual title of the talk.
Recommendations
- Place a sensor where the traffic to be protected passes in bundled form, for example behind the firewall in front of the servers.
- Only enable rules for services that actually run on the network, then measure packet loss and false alarms.
- Maintain rule sets regularly; a NIDS without current rules only detects old attacks.
Found a mistake or have something to add? Get in touch.
Links to the original source and the Web Archive open in a new tab.