By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
(Signature-based, Anomaly-based, Inline vs. Passive)
You’re a security analyst at a mid-sized company. Your firewall blocks known bad IPs, but yesterday, an attacker slipped through using a zero-day exploit—your logs show unusual traffic to an internal database, but no alerts fired. Why? Because your Intrusion Detection System (IDS) was only looking for known attack patterns (signatures), not weird behavior (anomalies). Meanwhile, your Intrusion Prevention System (IPS) was in passive mode, meaning it logged the attack but didn’t stop it.
IDS/IPS is your last line of defense before a breach becomes a headline. - IDS = "Security camera" (detects and alerts). - IPS = "Security guard with a taser" (detects and blocks). - Signature-based = "Wanted posters" (matches known attack patterns). - Anomaly-based = "Behavioral profiling" (flags anything unusual). - Inline vs. Passive = "Guard at the door vs. guard watching cameras."
Real-world stakes: - If you misconfigure your IPS, it might block legitimate traffic (false positives) or miss real attacks (false negatives). - If you don’t tune your anomaly-based IDS, it’ll drown you in alerts (like a smoke detector that goes off every time someone cooks bacon). - If you deploy inline IPS without redundancy, a single failure could take down your entire network.
Your mission: By the end of this guide, you’ll be able to: ? Deploy a signature-based IPS to block known attacks. ? Configure an anomaly-based IDS to catch weird traffic. ? Decide when to use inline vs. passive modes. ? Tune false positives/negatives in production.
alert tcp any any -> $HOME_NET 22 (msg:"SSH Brute Force";)
tcpdump
# Update packages sudo apt update && sudo apt upgrade -y # Install dependencies sudo apt install -y build-essential libpcap-dev libpcre3-dev libdumbnet-dev zlib1g-dev luajit hwloc liblzma-dev openssl libssl-dev pkg-config # Download and install Snort wget https://www.snort.org/downloads/snort/snort-2.9.20.tar.gz tar -xvzf snort-2.9.20.tar.gz cd snort-2.9.20 ./configure --enable-sourcefire make sudo make install # Verify installation snort -V
Expected output:
,,_ -*> Snort! <*- o" )~ Version 2.9.20 GRE (Build 123) '''' By Martin Roesch & The Snort Team
# Create directories sudo mkdir /etc/snort /etc/snort/rules /var/log/snort # Download community rules (signature-based) wget https://www.snort.org/rules/community -O community-rules.tar.gz tar -xvzf community-rules.tar.gz -C /etc/snort/rules # Configure snort.conf sudo cp etc/snort.conf /etc/snort/ sudo nano /etc/snort/snort.conf
Edit these lines in snort.conf:
snort.conf
# Set your home network (replace with your subnet) ipvar HOME_NET 192.168.1.0/24 # Enable inline mode (IPS) config policy_mode:inline # Include community rules include $RULE_PATH/community.rules
# Run in passive mode (IDS) to test rules sudo snort -A console -q -c /etc/snort/snort.conf -i eth0
Trigger a test alert (open another terminal):
# Simulate a port scan (should trigger an alert) nmap -sS 192.168.1.100
Expected output (in Snort terminal):
[] [1:1000001:1] Portscan detected [] [Priority: 0] 01/20-14:30:45.123456 192.168.1.50 -> 192.168.1.100 TCP TTL:64 TOS:0x0 ID:12345 IpLen:20 DgmLen:40 S* Seq: 0x12345678 Ack: 0x0 Win: 0x1000 TcpLen: 20
# Install required tools for inline mode sudo apt install -y iptables-persistent # Configure iptables to redirect traffic through Snort sudo iptables -I INPUT -j NFQUEUE --queue-num 0 sudo iptables -I OUTPUT -j NFQUEUE --queue-num 0 # Run Snort in inline mode (IPS) sudo snort -Q -c /etc/snort/snort.conf -i eth0
Test it:
# Try the same port scan again nmap -sS 192.168.1.100
Expected behavior: - The scan should be blocked (no responses). - Snort logs the attack and drops the packets.
# Edit the community rules to reduce false positives sudo nano /etc/snort/rules/community.rules
Example: Disable noisy rules (comment them out with #):
#
# alert tcp any any -> $HOME_NET 22 (msg:"SSH Brute Force"; flow:to_server; flags:S; threshold:type threshold, track by_src, count 5, seconds 60; classtype:attempted-dos; sid:1000001; rev:1;)
Restart Snort:
sudo pkill snort sudo snort -Q -c /etc/snort/snort.conf -i eth0
sudo useradd -r snort
ulimit -n 65535
keepalived
[]
[Priority: 1]
TCP TTL:128
pulledpork
"Your company’s anomaly-based IDS is generating too many false positives. What should you do?" --Retrain the model on recent traffic data (baseline adjustment). --"Switch to signature-based" (won’t help with false positives). --"Disable the IDS" (security risk).
Challenge: You’re a SOC analyst. Your Snort IPS is blocking a critical internal app because of a false positive. Find the offending rule and disable it without turning off the entire IPS.
Steps:1. Check Snort logs (/var/log/snort/alert).2. Identify the rule ID causing the block.3. Disable the rule in snort.conf.
/var/log/snort/alert
Solution:
# 1. Check logs for the blocked app (e.g., port 8080) grep "8080" /var/log/snort/alert # 2. Find the rule ID (e.g., sid:1000042) # Output: [1:1000042:1] "Internal App False Positive" [] # 3. Disable the rule in snort.conf sudo nano /etc/snort/snort.conf # Add this line to disable the rule: # suppress gen_id 1, sig_id 1000042 # 4. Restart Snort sudo pkill snort sudo snort -Q -c /etc/snort/snort.conf -i eth0
Why it works: - suppress tells Snort to ignore the rule without deleting it (easy to re-enable later). - Always test in passive mode first before inline.
suppress
snort -V
snort -A console -q -c /etc/snort/snort.conf -i eth0
snort -Q -c /etc/snort/snort.conf -i eth0
iptables -I INPUT -j NFQUEUE --queue-num 0
tail -f /var/log/snort/alert
Always test IDS/IPS changes in a lab first. - Use VirtualBox + pfSense to simulate a network. - Generate real attack traffic with tools like: - nmap (port scanning). - metasploit (exploits). - hping3 (custom packets). - Monitor false positives for 24-48 hours before deploying to production.
nmap
metasploit
hping3
Now go break (and fix) something. ?
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.