Ravindra BagaleCourses & study guides मराठी Track your progress

42. Evading IDS, Firewalls and Honeypots – Detection Games

Chala mitrano, Chapter 41 madhe session tokens baghitla – aata IDS, firewall ani honeypot (फसवा सापळा). Red try karto sensors chukavnyasathi – fragmentation, slow scan, blending with "normal" traffic. Aapan he shikto defence-first: kasa attacker try karto, so Blue better detection (शोध) rules lihu shakto. He CEH exam modules madhlo detection-game chapter aahe – evasion kit / production bypass recipe nahi. Ghabru naka – OWN host-only lab (Kali 192.168.56.10, Metasploitable 192.168.56.20, optional Suricata/firewalld VM). Lakshat theva: lab = prove alerts fire. Production = protect sensors, never "silence Snort" for a client without change control.

What you will learn in this chapter

  • IDS vs IPS vs firewall vs honeypot – detection vs prevention, CIA mapping
  • Signature vs anomaly IDS; false positives and false negatives (Snort / Suricata ideas)
  • Fragmentation, encoding, obfuscation – concepts; how modern IDS reassembles
  • Slow scans, timing, port knocking – what Blue logs and rate-alerts
  • Firewall types (packet filter, stateful, WAF, NGFW) and "evasion" as misconfig / allow-list gaps
  • Honeypots / honeynets (Cowrie-class) – deception ethics; alert when someone pokes the fake
  • Covering tracks vs log integrity (अखंडता), append-only, SIEM, NTP – Blue wins
  • Lab: Suricata or firewalld logging on OWN Amazon Linux / Ubuntu VM; benign Nmap vs OWN target
  • Project Build-Hack-Fix for Sahyadri Traders edge + ethics / IT Act
  • Purple-team interview lines you can actually say

Lab scope

Practice only against systems you own in host-only / isolated lab (Kali 192.168.56.10, Metasploitable 192.168.56.20, optional Snort / Suricata / firewalld lab VM e.g. 192.168.56.40). Nmap, tcpdump, and sensor installs stay pointed at host-only IPs. Never scan a neighbour, ISP, cloud account you do not own, or a live shop "to see if Snort notices". Never publish IDS-bypass runbooks, never disable a customer's sensor "for a demo", never hack-back from a honeypot. IT Act sections such as 43 and 66 apply if you access others' systems without authority (verify current text). Lab = learn detection. Production = protect.

Concepts in this chapter

  1. 42.1IDS vs IPS vs Firewall vs Honeypot – Why Each Exists
  2. 42.2Signature vs Anomaly IDS – False Positives and False Negatives
  3. 42.3Fragmentation, Encoding, Obfuscation – Concepts, Then Reassembly
  4. 42.4Slow Scans, Timing, Port Knocking – Nmap vs Blue Rate Alerts
  5. 42.5Firewall Types – What "Evasion" Means to Blue
  6. 42.6Honeypots and Honeynets – Deception, Ethics, Alerts
  7. 42.7Covering Tracks vs Log Integrity – Blue Wins
  8. 42.8Lab – Suricata or firewalld Logging on OWN VM
  9. 42.9Project, Ethics and IT Act
  10. 42.10Putting It Together – Purple Team Mindset

The chapter recap is at the end of the last concept page.

Chapter 42: IDS, firewalls and honeypots — detection — practice tasks

Open chapter lessons · Full guided lab: suricata local detection rule lab (not repeated here)

42.1 Run Suricata on a pcap

MediumIT

Why: IDS finds known bad traffic.

What: Scan a sample pcap with Suricata in your lab.

How:

  1. Install Suricata.
  2. suricata -r dns.pcap -l /tmp/suricata
  3. Read /tmp/suricata/fast.log or eve.json.

Expected output: Alerts or at least a clean run with stats.

Hint

See linked Suricata lab.

Answer / how to check
  1. Log file created.

42.2 Write a simple detection rule

HardBanking

Why: Custom rules catch your environment's threats.

What: Alert on HTTP URI containing .env.

How:

  1. Add a Suricata/Snort-style rule for http.uri content .env.
  2. Replay a curl to /.env through the sensor.

Expected output: Alert fires.

Hint

Test rules before production.

Answer / how to check
  1. fast.log shows your rule msg.

42.3 Honeypot vs real service (paper)

EasyHealthcare

Why: Honeypots must look real but stay isolated.

What: Mark each setup Safe or Risky.

Data file: honey.csv

Setup
Cowrie SSH on isolated host-only VM
Fake DB on same VLAN as real HIS
Public cowrie with outbound blocked + alerts

About this file: Made-up honeypot setups. Each row is one setup to judge.

How:

  1. Read the data file.

Expected output: Isolated VM Safe; honeypot on prod VLAN Risky; internet cowrie with monitoring Safe if isolated.

Hint

Never put honeypots next to patient data.

Answer / how to check
  1. One Risky item.

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)

  1. Write the lesson title, date and the exact lab target you are allowed to use.
  2. List three owned systems (VMs, apps, or cloud accounts) where this lesson applies.
  3. Run one safe check from the lesson on a lab system only. Paste the command and output.
  4. Write a two-sentence fix you would give a teammate.
  5. 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.