42. Evading IDS, Firewalls and Honeypots – Detection Games
42.2 Signature vs Anomaly IDS – False Positives and False Negatives
Signature / rule-based (Snort, Suricata rule language, many WAF rules): "if this byte pattern / this flow looks like known Nmap / known exploit kit → alert". Fast, explainable, interview-friendly. Misses brand-new payloads (false negative) until a rule exists.
Anomaly / baseline: "this host never did 4000 unique dest ports at 02:00" → alert. Catches unknowns; also catches the new backup job (false positive). SOC then hates the sensor – dangerous, because next step is disable.
Thodkyaat:
- False positive (FP) = alert, no real incident. Too many → alert fatigue.
- False negative (FN) = real attack, no alert. Silent fail. Exam modules love this pair.
- True positive = alert + real. Tune toward this; log the miss.
Snort / Suricata idea (Blue, not a payload kit): alert tcp any any -> $HOME_NET any (msg:"…"; flow:…; sid:…;). HOME_NET lab madhe 192.168.56.0/24 theva. Emerging Threats / ET Open rules = starting point; your local.rules = SME-specific (Raja-Rani billing port, etc.).
| Red team (attacker) does | Blue team (defender) detects / stops |
|---|---|
| Slightly changes a known payload so old signature misses (FN) | Protocol parsers + content-normalise; update rules; anomaly on rare dest |
| Floods junk alerts so real C2 hides (FP noise) | Thresholds, suppress with evidence, don't "sid: disable all" |
| Lives in allowed HTTPS to a CDN-like host | TLS/SNI/JA3-class telemetry, DNS logs, egress allow-list |
Ravindra Bagale's Tip
Students turn the default rules ON and then delete 10,000 alerts. Tuning = change HOME_NET, disable the 5 noisy lab SIDs with a ticket, not alert → /dev/null. Interview: define FP vs FN in one sentence each. Keep this in mind.
Ravindra Bagale's Tip – मराठी
Students default rules ON करतात आणि 10,000 alerts delete करतात. Tune = change HOME_NET, disable the 5 noisy lab SIDs with a ticket, alert → /dev/null नाही. Interview: FP vs FN प्रत्येकी एका वाक्यात सांगा. लक्षात ठेवा.
Ravindra Bagale's Tip – हिंदी
Students default rules ON करते हैं और 10,000 alerts delete कर देते हैं. Tune = change HOME_NET, disable the 5 noisy lab SIDs with a ticket, alert → /dev/null नहीं. Interview: FP vs FN एक-एक वाक्य में बताओ. ध्यान रखो.
Lab
On paper: one FP story (Zoya's nmap of OWN Metasploitable during approved class → SOC panic) and one FN story (slow scan below threshold). Write the tune action for each (allow-list Kali IP in lab only vs longer window). 8 lines.
Extended teaching notes
Why this lesson matters
Hardening is deleting unnecessary risk: fewer packages, fewer open ports, fewer privileged accounts, faster patches, better logs.
Hardening related services
[('SSH', 'Key auth, no root login, Fail2ban or equivalent, SG limited to your IP/VPN.', '', ''), ('SMB / NFS / LDAP / SNMP', 'Do not expose to the internet; patch; strong auth; disable unused versions (e.g. SMBv1).', '', ''), ('SMTP', 'Authenticated relay only; SPF/DKIM/DMARC for your domains.', '', ''), ('DNS', 'Restrict zone transfers; monitor for unexpected records (crt.sh for certs).', '', ''), ('Firewalls', 'Host firewall + cloud SG/NSG; default deny; document every allow.', '', '')]
Real examples
Global: CIS Benchmarks exist for Linux, Windows and clouds. Indian company (sample): a Pune team requires SSH keys only and weekly patch windows for internet-facing hosts.
Mini case study
Suppose we are on a purple-team exercise for an Indian mid-size company (sample data). Red notes a technique from this lesson against a lab clone. Blue must show the control that stops it, the log that would have fired, and the ticket that hardens production. That is the standard this course trains you for.
Defender's worksheet (do this today)
- Write the lesson title, date and the exact lab target you are allowed to use.
- List three owned systems (VMs, apps, or cloud accounts) where this lesson applies.
- Run one safe check from the lesson on a lab system only. Paste the command and output.
- Write a two-sentence fix you would give a teammate.
- Name one related public advisory (CERT-In, CISA, NVD, or a vendor bulletin) with its date.
Indian workplace (sample data)
Suppose we are a junior analyst at Infosys, TCS, Wipro or a fintech SOC in Bengaluru/Pune. Turn this lesson into one checklist item with an owner, a due date and a place to store evidence (ticket + screenshot).
Global practice
Compare your notes with OWASP, CIS Benchmarks, NIST CSF/IR guidance or a cloud Well-Architected security question. Write five lines on what overlaps.
Everyday analogy
Explain the risk and the fix to a family member without jargon. If they can repeat the warning, you understand it well enough to teach juniors.
Key terms
- Control: a safeguard (patch, config, process, detection).
- Finding: a weakness backed by evidence.
- Remediation: the fix plus how you verified it.
- Scope: systems you have written permission to touch.
- Least privilege: only the access the task needs.
- Defence in depth: several layers so one failure does not end the story.
Common mistakes
- Skipping written permission "just for a quick scan".
- Practising on hostel, office or public targets without authorisation.
- Collecting tool output without writing the fix.
- Copying attack steps onto production to "verify". Defenders verify with versions, configs and patches.
- Publishing screenshots that contain secrets, cookies or internal hostnames.
Recap
- Evidence, fix, owner, date.
- Own lab only.
- Fix > spectacle.