42. Evading IDS, Firewalls and Honeypots – Detection Games
42.7 Covering Tracks vs Log Integrity – Blue Wins
CEH phase "covering tracks" = delete logs, change timestamps, stop syslog. Blue answer is not "hope they forget". Blue answer:
- Logs leave the box (rsyslog/SIEM/Wazuh) the moment they are born
- NTP / chrony so timestamps match across Kali demo + Suricata + firewalld
- Append-only / WORM or at least remote write-only
- File integrity (AIDE/auditd) on
/var/logandsuricata.yaml - Restricted
root;sudoI/O logs
Red can wipe a local fast.log. Red cannot un-send the copy already on the SIEM in Nagpur.
# Amazon Linux lab – time + audit + syslog (illustrative)
sudo yum install chrony audit rsyslog
sudo service chronyd start
sudo systemctl enable chronyd
sudo service auditd start
sudo service rsyslog start
date
# Integrity idea: after hardening, initialise AIDE (package name may vary)
# sudo yum install aide && sudo aide --init
| Red team (attacker) does | Blue team (defender) detects / stops |
|---|---|
rm / truncate local IDS log |
Remote syslog; alert on log volume drop to zero |
| Sets clock back to confuse IR | chrony + alert on time step; compare SIEM ingest time |
Stops suricata service |
systemd/service monitor; missing-heartbeat in SIEM |
Ravindra Bagale's Tip
Students say "local logs are enough". The first command a Red actor learns = clear the logs. Interview: "My IDS alert is not real until it is off-box." Got it?
Ravindra Bagale's Tip – मराठी
Students "logs local असले तरी enough" म्हणतात. Red शिकतो तो पहिला command = clear logs. Interview: "My IDS alert is not real until it is off-box." समजले का?
Ravindra Bagale's Tip – हिंदी
Students कहते हैं "logs local हैं तो enough". Red जो पहला command सीखता है = clear logs. Interview: "My IDS alert is not real until it is off-box." समझ आया?
Lab
On .40, sudo service suricata stop (lab only) then start again. Write an alert pseudo-rule: suricata heartbeat missing 2 minutes → ticket. Prove chronyd is running (sudo service chronyd status). Don't practise log wiping – practise detecting absence.
Extended teaching notes
Why this lesson matters
A SOC turns logs into action. Good juniors triage with playbooks: what fired, which asset, how bad, contain or escalate, write the timeline.
- Prepare: asset list, contacts, runbooks.
- Detect: SIEM/EDR alerts with context.
- Contain: disable account, isolate host, block IOC.
- Eradicate & recover: patch, rebuild, restore.
- Lessons: one improvement ticket per incident.
Indian company (sample)
A 24×7 SOC at a large Indian IT services firm handles phishing and malware for many clients. Tier-1 analysts follow a script; they do not freestyle on production.
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.