[Home] [Credit Search] [Category Browser] [Staff Roll Call] | The LINUX.COM Article Archive |
Originally Published: Tuesday, 16 October 2001 | Author: Shashank Pandey |
Published to: enchance_articles_security/Advanced Security Articles | Page: 3/4 - [Printable] |
Intrusion Detection Systems for the Uninitiated, Part 2; Installing and Configuring Snort
Shashank Pandey returns to Linux.com with part two of his popular series on IDS: Intrusion detection Systems for Linux. Quizzing PortSentry in his last article, in today's Pandey cast a sharp eye over working with snort. And remember in some primitive parts of the world you have to pay for information like this! Can you imagine?
|
<< Page 3 of 4 >> | |
Snort USAGE and its ModesRight. I hope you are still with me.Now, what we'll do here is, we'll discuss the concepts and then commands in proper detail. Let us start with a simple command that makes Snort display all the command switches and then exit. root@lord snort -? Gosh! So many switches?! If you are wondering, I will just discuss a few good ones and leave the other simpler ones for you to explore yourself. But before that, we will speed through some snort fundamentals Snort- ModesSo, Like I told you some time back, snort runs in three different modes :Sniffer Mode: When in this mode, Snort reads and decodes all packets from the network(passing though your ethernet card) and dumps them to the stdout(your screen!). To put Snort into straight sniffing mode(use '-v' verbose switch.) :
Note: This will dump the packet headers only. To see the headers + the packet payloads :
Tip: To test it on localhost : do this :
from one console and 'telnet/ftp' to your localhost from another console. Ta-da! You can see all those packets transferred between localhost and ur telnet client in the sniffer window. Cute? Packet Logger Mode:This mode logs the packets to the disk in their decoded ASCII format.
Intrusion detection ModeWhen an alert rule goes off the alert data is logged to the alerting mechanism (by default a file called "alert" in the logging directory but can be through syslog, Winpop messages etc.) In addition to being logged to the logging mechanism. The default logging directory is /var/log/snort, which can be changed using the "-l" switch.Now consider a typical snort command for packet analysis:
Here, we are considering the a class C subnet with host I.P s ranging from 192.168.3.0-192.168.3.255(subnet-mask:255.255.255.255) Let's see the dissection of the above mentioned command to know what it means:
Now, in the next example we will make Snort generate alerts: To generate alerts, use the '-A' switch . -A - Alert using the specified alert-mode. Snort alert modes include but not limited to:
. The command will then change to the following.
To send alert messages to the syslog daemon, use the '-s' switch instead. Alerts will appear in /var/log/secure or /var/log/messages ,most likely :
Until now all the packets sniffed and analyzed were just dumped to your screen. To have Snort dump the packets sniffed and analyzed to your logs, you will use the "-l" switch. And then the directory name i.e /var/log/snort:
To log packets in tcpdump format and produce minimal alerts , use the '-b' command switch
In the above mentioned commands, Snort logs all the packets on your network segment that might leave you with a confusing mess. If you want to log only certain types of packets depending on the rules you write , use the '-c' command switch.
Writing rules for snortI would rather guide you to this place :"Writing Snort Rules : How to Write snort Rules and Keep your Sanity" (http://www.snort.org/writing_snort_rules.htm) by Martin Roesch. Ok. So, we go on.
| |
<< Page 3 of 4 >> |