38. Active Directory Attacks and Defence
38.2 Safe AD Lab Setup
Production AD var "try" = gunha. Aapan VirtualBox/VMware madhe teen VMs (host-only 192.168.56.0/24):
- Windows Server (Evaluation OK) → promote to DC for
sahyadri.lab(orrajarani.lab). Static IP plan (book lab): Kali192.168.56.10, DC192.168.56.30, client192.168.56.40. - Windows 10/11 member joined to domain – daily driver user
zoya/ service account later. - Kali – Impacket, BloodHound.py / SharpHound only against this lab.
Install AD DS role, create domain, create OUs (Users, Servers, Workstations), two normal users (shahrukh, amir), one helpdesk group, one SPN service account (later for Kerberoast lab). Snapshot before weakening anything.
Never bridge the DC to your real office Wi-Fi for "easy internet" while running attack tools. Host-only + optional NAT on Kali alone is enough. Aata pudhe jaauya.
| Red team (attacker) does | Blue team (defender) detects / stops |
|---|---|
| Builds identical weak lab to practice paths safely | Same lab used by Blue to validate detections (Event IDs, Sysmon) before production |
Accidentally scans 192.168.1.0/24 home/office |
Strict host-only adapter; written lab IP list on sticky note; firewall deny other subnets |
| Uses real org names/passwords in lab | Fictional sahyadri.lab only; unique lab passwords never reused at work |
Ravindra Bagale's Tip
Students put the DC on a bridged network, and when they run Impacket a neighbour's PC gets scanned. Even as an accident, that can amount to an illegal act. Adapter = Host-Only. Take a snapshot, then try weak configs – restore after fixing. Never paste production credentials into the lab.
Ravindra Bagale's Tip – मराठी
Students DC ला bridged network देतात आणि Impacket चालवताना शेजाऱ्याचा PC scan होतो. हा अपघात असला तरी illegal ठरू शकतो. Adapter = Host-Only. Snapshot घेऊन weak configs try करा – fix नंतर restore. Production credentials lab मध्ये paste नको.
Ravindra Bagale's Tip – हिंदी
Students DC को bridged network दे देते हैं और Impacket चलाते समय पड़ोसी का PC scan हो जाता है. यह हादसा हो तो भी illegal माना जा सकता है. Adapter = Host-Only. Snapshot लेकर weak configs try करो – fix के बाद restore. Production credentials lab में paste नहीं.
Lab
VirtualBox/VMware madhe DC + Win10 + Kali host-only set kara. DC: AD DS install, domain sahyadri.lab, DNS on DC. Client join domain. Kali: ping 192.168.56.30 ani nxc ldap 192.168.56.30 (auth nantar – pudhe). Screenshot three IPs aaplya notes madhe. Written permission page: "I own this lab."
Extended teaching notes
Why this lesson matters
Active Directory is the identity plane for many Indian enterprises. Attack path tools exist so defenders can remove dangerous edges: excessive admin rights, unconstrained delegation, stale accounts.
- Tiered admin model; no daily Domain Admin use.
- LAPS for local admin passwords.
- Monitor for unusual Kerberos / replication behaviour.
- Lab AD only — never against a corporate domain without a signed engagement.
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.