Ravindra BagaleCourses & study guides

42. Evading IDS, Firewalls and Honeypots – Detection Games

42.8 Lab – Suricata or firewalld Logging on OWN VM

Pick one Blue stack (both if time). Target stays host-only.

Path A – Suricata (Ubuntu often easiest; Amazon Linux 2023: try yum, extras, or use Ubuntu sensor VM):

# Amazon Linux / CentOS-style
sudo yum install suricata
# Ubuntu:
# sudo apt update && sudo apt install -y suricata
sudo service suricata start
sudo service suricata status
# Confirm interface in /etc/suricata/suricata.yaml (host-only nic – name varies)
# Set HOME_NET to "[192.168.56.0/24]" then:
sudo service suricata restart
sudo tail -f /var/log/suricata/fast.log
# JSON (if eve enabled):
# sudo tail -f /var/log/suricata/eve.json

Path B – firewalld only (Amazon Linux friendly):

sudo yum install firewalld
sudo systemctl enable firewalld
sudo service firewalld start
sudo firewall-cmd --set-log-denied=all
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.56.0/24" port port="1-1024" protocol="tcp" log prefix="LAB-SCAN " level="warning" drop'
# (lab example – don't blindly drop 22 if you still need SSH; exclude mgmt port)
sudo firewall-cmd --reload
sudo tail -f /var/log/messages

Then from Kali (OWN only):

nmap -sS -T2 192.168.56.20
nmap -sS -T2 -p 22,80,443 192.168.56.40

Expected: some alert or LAB-SCAN / denied line. If zero: wrong NIC, HOME_NET, or VirtualBox host-only promiscuous mode off (needed only if sensor is not the destination). Ghabru naka – debugging the sensor is the lab.

Red team (attacker) does Blue team (defender) detects / stops
Nmap against OWN Metasploitable / edge VM fast.log / eve.json / firewalld denied with src 192.168.56.10
Hopes student left Suricata stopped sudo service suricata status in the lab checklist
Scans too fast and blames IDS for "spam" Use -T2; tune SID; don't disable the engine

Ravindra Bagale's Tip

Students systemctl start copypaste kartat – aaplya notes madhe sudo service suricata start, enable only for boot. Yaml edit nantr restart ani tail prove. Interview: walk "install → HOME_NET → generate traffic → show alert". Dhyan rakho.

Lab

Pair: Amir installs Path A or B on .40; Zoya runs the two nmap lines from Kali. Both sign the ethics line (host-only). Screenshot alert + matching nmap timestamp. Revert if rules lock you out of SSH.