Snort Lab
Snort Lab
VM Details
[group01.apnictraining.net] [192.168.30.1]
[group02.apnictraining.net] [192.168.30.2]
......
[group10.apnictraining.net] [192.168.30.10]
[group11.apnictraining.net] [192.168.30.11]
......
[group20.apnictraining.net] [192.168.30.20]
[group21.apnictraining.net] [192.168.30.21]
......
[group30.apnictraining.net] [192.168.30.30]
Install SNORT
1. Install SNORT:
2. It will ask for your HOME_NET address. For this lab define it as your host IP. Example, for
group 11 it will 192.168.30.11/32 . If required we can change it later from
snort.debian.conf file also.
3. Check the installation location of SNORT
whereis snort
Configure SNORT
During installation process if you had defined your HOME_NET properly; no need to edit it. Else,
you can edit this file.
sudo vi /etc/snort/snort.conf
This is a big configuration file; for the purpose of this lab we will disable all predefined rules
(ruleset).
Disable (comment out # ) all the line having include $RULE_PATH (in Step 7 of
configuration file) except include $RULE_PATH/local.rules .
To enable alert log; comment out (adding # before the line) the following line (Step 6 in the
configuration file):
Start SNORT:
or
or
ps -ef|grep snort
SNORT Rules
1. Rule Header : The rule header contains the rule's action, protocol, source and destination IP
addresses and netmasks, and the source and destination ports information.
2. Rule Options : The rule option section contains alert messages and information on which parts of the
packet should be inspected to determine if the rule action should be taken.
http://manual-snort-org.s3-website-us-east-1.amazonaws.com/node28.html
sudo vi /etc/snort/rules/local.rules
alert ip any any -> any any (msg: "IP Packet detected"; sid: 1000001;)
Save and exit. Restart snort service
This rules will generate alert for every packet. Try to ping any destination and check alert log
file:
REMOVE (or comment out) the bad rule from local.rules once you have seen the alert!
SNORT Exercise
Excercise 1 : Write a rule to check XMAS scan on your server from external network
Exercise 2 : Write a rule to check any external network access your webserver /admin pages
Exercise 3 : Write a rule to check SSH brute force attack and log IP trying to connect more than 3 times in
60 seconds (the threshold option may be deprecated*)
***END OF EXERCISE***