Network-based intrusion detection system using snort. A project for CodeAlpha internship.
- Virtual box
- Kali linux OS
- Ubuntu server(latest version)
- Active internet
- Snort installation
- Nmap for scanning IP
1οΈβ£ First Install Virtualbox
2οΈβ£ Import Kali Linux
3οΈβ£ Download Ubuntu server .iso file from its main website:
4οΈβ£ Import the iso file to virtualbox and run the new instance
Quick remainder: Change the network setting to bridged adapter and set promiscuous mode to 'Allow All', before running the server(also do it for kali linux).
1οΈβ£ Identify your IP address:
ifconfigGet the interface info i.e, wlan0 or enp0s3
screenshot: IP-Address
2οΈβ£ In Ubuntu instance update system packages:
sudo apt update && sudo apt upgrade -y3οΈβ£ Install Snort:
sudo apt install snortDuring mid installation an option to enter the local network range is shown. Type your machine's network ip range, for example 192.168.xx.0/32
4οΈβ£ Verify Snort installation:
snort -Vscreenshot: snort-version
1οΈβ£ You can add/change rules for detection by(This step is not mandatory as snort comes with many set of rules):
sudo nano /etc/snort/rules/local.rulesWe only need to add new rules for additional security and protective measures as there are plenty of built-in rules for snort. screenshot: snort-rules
2οΈβ£ Ensure the configuration file is present:
sudo nano /etc/snort/snort.confscreenshot: conf-file
1οΈβ£ First check if snort.conf file is successfully running:
sudo snort -T -c /etc/snort/snort.conf -i enp0s3screenshot: snort-success
2οΈβ£ Next the snort IDS in alert mode:
sudo snort -A console -c /etc/snort/snort.conf -I enp0s3screenshot: IDS-alert
3οΈβ£ Back in Kali OS open terminal and scan the server using the above IP address
nmap -Pn 192.168.x.xscreenshot: Nmap-scan
4οΈβ£ Next give a ping request
ping 192.168.x.xscreenshot: Ping-request
In the Ubuntu server instance you will be able to see the alerts popping up for the snort scan.
1οΈβ£ Run Snort with logging enabled:
sudo snort -A console -c /etc/snort/snort.conf -I enp0s3 -l /var/log/snort2οΈβ£ View alerts:
sudo cat /var/log/snort/snort.alert.fastscreenshot: log-alerts
- Scan UPnP service discover attempt
- ICMP Ping Detected
- Suspicious TCP connection attempts
screenshot: example-alerts