PISA Pakistan — Community CERT

← 🚩 CTF: Getting Started

29. Active Directory Attack & Defense for CTF

⏱ 8 min

Active Directory Attack & Defense for CTF

Why AD is central to CTF labs

Active Directory (AD) is the backbone of Windows enterprise networks in government, banking, and telecom sectors across Pakistan. CTF organizers often emulate realistic corporate intrusions using AD domains, making knowledge of Kerberos, NTLM, and LDAP attacks essential.

Enumeration with BloodHound and PowerView

  1. Deploy a Kali Linux VM and connect to the lab domain.
  2. Run BloodHound.py to collect AD data: bloodhound-python -d lab.local -u recon -p Password123! -c All.
  3. Import the generated JSON into BloodHound GUI and highlight Shortest Path to Domain Admin.
  4. Use PowerView for quick LDAP queries: Get-NetUser -Domain lab.local | Select-Object samaccountname, description.

Kerberos Attacks (AS‑REP Roasting & Kerberoasting)

  • AS‑REP Roasting (T1558.004): Request AS‑REP tickets for users with Do not require Kerberos preauthentication. Crack with Hashcat.
  • Kerberoasting (T1550.003): Use Impacket’s GetUserSPNs.py to request service tickets, then offline crack with hashcat -m 13100.

ACL Abuse & DCSync

  • Enumerate WriteDACL permissions with PowerView. Abuse to grant DCSync rights, then secretsdump.py to dump hashes.
  • Tools: Mimikatz, Rubeus, CrackMapExec.

Pakistani Context

When practicing in labs that mimic NADRA or SBP environments, avoid touching production systems. Report any real‑world compromise to the NCCIA cybercrime helpline 1799.

Do / Don't

  • Do use isolated lab VMs and never run Mimikatz against production AD.
  • Don’t skip BloodHound enumeration; the visual graph often reveals hidden attack paths.
  • Do document every step in your write‑up for reproducibility.

Takeaway

Run BloodHound in your lab today to map trust relationships and identify the fastest route to Domain Admin.

← PrevNext →