This Blog is intended to collect information of my various Intrests,pen my opinion on the information gathered and not intended to educate any one of the information posted,but are most welcome to share there view on them
Thursday, January 26, 2012
Snort: 5 Steps to Install and Configure Snort on Linux
Snort is a free lightweight network intrusion detection system for both UNIX and Windows.
In this article, let us review how to install snort from source, write rules, and perform basic testing.
1. Download and Extract Snort
Download the latest snort free version from snort website. Extract the snort source code to the /usr/src directory as shown below.
# cd /usr/src
# wget -O snort-2.8.6.1.tar.gz http://www.snort.org/downloads/116
# tar xvzf snort-2.8.6.1.tar.gz
Note: We also discussed earlier about Tripwire (Linux host based intrusion detection system) and Fail2ban (Intrusion prevention framework)
2. Install Snort
Before installing snort, make sure you have dev packages of libpcap and libpcre.
Create the following snort.conf and icmp.rules files:
# cat /etc/snort/snort.conf
include /etc/snort/rules/icmp.rules
# cat /etc/snort/rules/icmp.rules
alert icmp any any -> any any (msg:"ICMP Packet"; sid:477; rev:3;)
The above basic rule does alerting when there is an ICMP packet (ping).
Following is the structure of the alert:
(rule options)
Table: Rule structure and example
Structure
Example
Rule Actions
alert
Protocol
icmp
Source IP Address
any
Source Port
any
Direction Operator
->
Destination IP Address
any
Destination Port
any
(rule options)
(msg:”ICMP Packet”; sid:477; rev:3;)
5. Execute snort
Execute snort from command line, as mentioned below.