DAY 23
🛡️ ETHICAL HACKING COURSE
FREE

Part of the 100-Day Free Ethical Hacking Course — from complete beginner to professional penetration tester

Day 23 of 100 · 23% complete · Enterprise territory starts here

If web application hacking is the ground floor of ethical hacking, Active Directory is the penthouse — and almost every enterprise in the world lives there. The moment you genuinely understand active directory basics, an entirely new attack surface opens that leads to total domain compromise: every user credential, every server, every file share, every application in the organisation. Roughly 90% of Fortune 500 companies run Active Directory. Knowing how to enumerate and attack it is the single most valuable skill you can build as a professional penetration tester.

🎯 What You’ll Master in Day 23
Understand the Active Directory object model — forests, domains, OUs, users, groups, GPOs
Explain how Kerberos authentication works and identify its exploitable weaknesses
Map the complete attack surface of a standard enterprise AD environment
Set up a fully functional free AD lab using Windows Server evaluation software
Run your first LDAP and SMB enumeration commands from Kali Linux against a domain

⏱️ 28 min read · 3 hands-on exercises

📊 How familiar are you with Windows Active Directory environments?




✅ Perfect — this guide builds from zero to working AD lab and first enumeration commands. Jump to your level using the TOC.

On Day 22 we covered exploitation techniques beyond Metasploit — manual methods that work when automated frameworks fail. Today we step into the territory that most enterprise penetration testing engagements are fundamentally about: Windows Active Directory environments. The next eight days of this course cover AD exclusively, from structure today through to domain compromise by Day 31.

This is Day 23 of the 100-Day Free Ethical Hacking Course. Everything you have learned so far — Linux commands, networking, web application vulnerabilities, exploitation techniques — feeds directly into what comes next. AD is where all those skills converge into real enterprise-level penetration testing.


What Is Active Directory and Why Every Enterprise Runs It

Active Directory (AD) is Microsoft’s centralised directory service — a system for managing users, computers, groups, policies, and resources across an entire Windows network from a single point of control. Introduced with Windows 2000 Server, it has been the backbone of enterprise IT infrastructure for over two decades. As of 2026, approximately 90% of organisations with more than 100 employees use Active Directory as their primary identity and access management platform.

Active Directory works on a single fundamental principle: every resource in the domain — whether it is a file server, a web application, or a printer — trusts the Domain Controller to verify who a user is and what they are allowed to access. This centralised trust model is enormously efficient for IT administration, but from a security perspective it creates a single point of total failure. Compromise the Domain Controller, and you compromise everything.

securityelites.com
Enterprise AD Architecture — The Ethical Hacker’s View
🌲 FOREST: corp.local — Schema Master + Domain Naming Master
🏢 ROOT DOMAIN: corp.local
DC01 · DC02 · RID Master · PDC Emulator
OUs:
├ Domain Admins (HIGH VALUE)
├ Service Accounts (KERBEROAST)
├ Workstations OU
└ Standard Users OU

🏢 CHILD DOMAIN: dev.corp.local
DC03 · Development environment
⚠️ Trust: bidirectional
→ pivot path to root
├ Dev Servers (often weak)
└ Dev Users OU

💻 Workstations + 🖥️ Member Servers + 🔒 Domain Controllers — all trust the domain

📸 Enterprise AD architecture showing a two-domain forest — the bidirectional trust between child and root domain is a common lateral movement path that ethical hackers exploit once they have a foothold in the dev environment
💡 Why DA is the Crown Jewel: Domain Admin access to a root domain means: full credential access to every user account, ability to create persistent backdoor accounts, ability to forge Kerberos tickets valid for years, administrative access to every domain-joined machine, and access to every file share in the domain. This is why AD compromise is the primary objective of most enterprise red team operations.

🧠 EXERCISE 1 — THINK LIKE A HACKER (2 MIN · NO TOOLS)
Map the 5-step path from workstation to Domain Admin

⏱️ Time: 2 minutes · No tools required

Before reading the rest of this guide, write down the five logical steps needed to go from “low-privileged user on a workstation” to “Domain Admin of the entire domain.” Think about what information and access you need at each step.

Step 1: Initial access → How do you land on a workstation inside the domain?
Step 2: Local privilege escalation → How do you become local admin on that machine?
Step 3: Credential harvesting → How do you get domain credentials from that machine?
Step 4: Lateral movement → How do you reach a machine where a DA is logged in?
Step 5: Domain compromise → How do you capture or escalate to Domain Admin?

This is the AD attack chain. Every technique in Days 24–31 maps to one of these five steps. Knowing where you are in the chain tells you exactly what you need to do next — this is how real red team operators think.

✅ What you just learned: AD compromise is not a single exploit — it is a methodical five-step chain. Professionals who understand the chain are systematically efficient; those who do not waste time trying random attacks with no direction. Internalise this chain before moving to Day 24.

📸 Draw your attack chain (even on paper) and share a photo in #day23-mindmap on Discord.

🧠 QUICK CHECK — Section 1

Why is compromising a Domain Controller more impactful than compromising a single server?




Forest, Domain, OU — The AD Object Hierarchy Explained

Active Directory uses a strict four-level hierarchy: Forest → Domain → Organisational Unit (OU) → Objects. Understanding this hierarchy tells you where high-value targets live, which trust boundaries exist, and which attacks are possible at each level.

The Hierarchy From Top to Bottom

FOREST (corp.local) ← Highest container. Schema Master = highest privilege target.
├── DOMAIN (corp.local) ← Root domain. Domain Admin here controls all child domains.
│ ├── OU: Domain Controllers ← Most protected. Contains all DCs.
│ ├── OU: Users ← Standard user accounts.
│ ├── OU: Service Accounts ← Often misconfigured. Kerberoasting goldmine.
│ ├── OU: Computers ← Workstations and member servers.
│ └── OU: Admins ← High-value credential targets.
└── DOMAIN (dev.corp.local) ← Child domain. Trust relationship = lateral movement path.
└── TRUST → corp.local (bidirectional) ← Compromise child = potential path to root

The key objects inside a domain that matter most for penetration testing are: User accounts (regular users and service accounts), Computer accounts (workstations and servers), Security Groups (especially Domain Admins, Enterprise Admins, Schema Admins), and Group Policy Objects (GPOs) that control security settings across all domain-joined machines.

FSMO Roles — Five Special Domain Controllers Every Red Teamer Knows

Every AD forest and domain assigns exactly five Flexible Single Master Operation (FSMO) roles to specific domain controllers. These roles matter to ethical hackers because the servers that hold them are high-impact targets whose compromise has domain-wide consequences beyond standard Domain Admin.

FSMO ROLES — High-Value Red Team Targets
# FOREST-LEVEL ROLES (one per forest, highest impact):
Schema Master — Controls AD schema changes. Compromise = redefine all object types.
Domain Naming Master — Manages domain additions/removals from the forest.

# DOMAIN-LEVEL ROLES (one per domain):
RID Master — Allocates RID pools (used in SID generation for new objects).
PDC Emulator — Time sync, account lockout management, GPO updates. Primary target.
Infrastructure Master — Manages cross-domain object references.

# Find FSMO role holders from a domain-joined Windows machine:
netdom query fsmo

# From Kali using impacket (requires domain credentials):
python3 /usr/share/doc/python3-impacket/examples/GetADUsers.py \
-all corp.local/user:password@dc01.corp.local


Kerberos Authentication — How It Works and Where It Breaks

Kerberos is the primary authentication protocol in Active Directory, replacing NTLM for most domain authentication. Understanding how it works at the ticket level is mandatory for AD hacking — every major AD attack technique from Day 24 onwards exploits a specific weakness in Kerberos design or configuration.

securityelites.com
Kerberos 3-Step Authentication — With Attack Vectors
1
AS-REQ / AS-REP (Authentication Service Exchange)
Client → KDC: “Authenticate me, I am user1” (includes encrypted timestamp)
KDC → Client: Ticket Granting Ticket (TGT) encrypted with the krbtgt account hash
⚠️ AS-REP Roasting: Accounts with pre-auth disabled return an encryptable hash → crack offline

2
TGS-REQ / TGS-REP (Ticket Granting Service Exchange)
Client presents TGT → requests Service Ticket for target service (e.g., MSSQL)
KDC returns Service Ticket encrypted with the service account’s password hash
⚠️ Kerberoasting: Any domain user can request service tickets → crack offline without alerting target

3
AP-REQ / AP-REP (Application Service Exchange)
Client presents Service Ticket to the actual service → service validates and grants access
No plaintext password ever sent over the network — only encrypted tickets
⚠️ Pass the Ticket: Steal a valid ticket and present it directly — no password needed ever

📸 Kerberos 3-step flow with attack vectors mapped to each step — AS-REP Roasting attacks Step 1, Kerberoasting attacks Step 2, and Pass the Ticket attacks Step 3. These are the techniques we build in Days 25–26.

The critical design insight is this: Kerberos assumes the KDC is always trusted and tickets are time-bounded but not session-bounded. An attacker who can steal or forge a Kerberos ticket can authenticate as any user — including Domain Admin — without knowing that user’s password. A Golden Ticket forged from the krbtgt hash remains valid for 10 years by default. This is why these techniques form the core of the most impactful AD attacks you will learn in Days 25 and 26.

🧠 QUICK CHECK — Section 3

Kerberoasting attacks which step of the Kerberos flow?




The AD Attack Surface — What Ethical Hackers Target First

A standard enterprise AD environment presents dozens of potential misconfigurations and attack surfaces. Knowing how to enumerate these systematically is what separates a professional assessment from a list of CVEs from a vulnerability scanner. The list below is the standard priority order that experienced red teamers follow in every AD engagement.

AD ATTACK SURFACE — Prioritised Target List
# TIER 1 — Leads to immediate credential access or Domain Admin
Service accounts with SPNs → Kerberoasting (Day 25) — offline hash cracking
Accounts without pre-auth → AS-REP Roasting (Day 25) — no credentials needed
Unconstrained delegation hosts → TGT theft from connecting privileged users
LLMNR / NBT-NS enabled → Responder hash capture (Day 29)
NTLM authentication enabled → Pass the Hash, NTLM relay attacks (Day 26)

# TIER 2 — Requires some access but leads to escalation
Weak service account passwords → Password spray, cracking, credential reuse
Misconfigured ACLs/DACLs → GenericAll / WriteDACL privilege escalation
AdminSDHolder misconfiguration → Persistent privilege escalation path
Print spooler enabled on DCs → PrinterBug coercion for hash capture

# TIER 3 — Information gathering and lateral movement enablers
User enumeration via RPC/LDAP → Build target list for spraying
Password policy query → Determine spray threshold before lockout
SMB shares with open access → Sensitive data discovery
Domain trust relationships → Cross-domain lateral movement mapping

⚠️ Attack Surface ≠ Attack Plan: Do not work through this list randomly. Professional penetration testers follow the five-step chain from Exercise 1: initial access → local privilege escalation → credential harvesting → lateral movement → domain compromise. The attack surface list tells you what to look for within each step — not the order to try everything.

Building Your Free AD Lab — Complete Step-by-Step Setup

Every technique from Day 24 onwards requires a working Active Directory lab. The good news is that you can build a fully functional AD environment for zero cost using Microsoft’s evaluation software. Here is the exact setup I recommend for every student taking this course.

What You Need

LAB REQUIREMENTS — Minimum Specs
# HOST MACHINE minimum specs:
CPU — 4 cores (6+ recommended)
RAM — 16GB minimum (8GB absolute minimum with page file)
DISK — 150GB free space for VM storage

# SOFTWARE (all free):
VirtualBox — https://virtualbox.org (free hypervisor)
Windows Server 2022 eval — https://www.microsoft.com/evalcenter (free 180 days)
Windows 10/11 eval — https://www.microsoft.com/evalcenter (free 90 days)
Kali Linux — https://kali.org (free forever)

# VM ALLOCATION:
DC01 (Windows Server 2022) — 4GB RAM, 60GB disk, host-only network
WIN10-WS (Windows 10 eval) — 4GB RAM, 60GB disk, host-only network
KALI (Kali Linux) — 4GB RAM, 40GB disk, host-only network

Step-by-Step Domain Controller Setup

WINDOWS SERVER — Promote to Domain Controller
# Run in PowerShell as Administrator on Windows Server 2022:

# Step 1 — Install AD Domain Services role
Install-WindowsFeature AD-Domain-Services -IncludeManagementTools

# Step 2 — Promote server to Domain Controller (creates new forest)
Install-ADDSForest `
-DomainName “lab.local” `
-DomainNetbiosName “LAB” `
-ForestMode “WinThreshold” `
-DomainMode “WinThreshold” `
-InstallDns:$true `
-Force:$true
# Server reboots automatically — sign in as LAB\Administrator after reboot

# Step 3 — Create lab users (run after reboot)
New-ADUser -Name “Alice Smith” -SamAccountName “asmith” -AccountPassword (ConvertTo-SecureString “Password123!” -AsPlainText -Force) -Enabled $true
New-ADUser -Name “Bob Jones” -SamAccountName “bjones” -AccountPassword (ConvertTo-SecureString “Winter2026!” -AsPlainText -Force) -Enabled $true

# Step 4 — Create a service account WITH an SPN (for Kerberoasting practice)
New-ADUser -Name “SQL Service” -SamAccountName “sqlsvc” -AccountPassword (ConvertTo-SecureString “MSSQLSvc2026” -AsPlainText -Force) -Enabled $true
setspn -A MSSQLSvc/dc01.lab.local:1433 LAB\sqlsvc

# Step 5 — Disable password complexity for easier lab use (DO NOT do this in production)
Set-ADDefaultDomainPasswordPolicy -Identity “lab.local” -ComplexityEnabled $false -MinPasswordLength 6

🛠️ EXERCISE 2 — BROWSER ONLY (NO INSTALL)
Use TryHackMe’s free AD introductory room to explore a live AD environment

⏱️ Time: 20–30 minutes · Target: TryHackMe (authorised platform)

If your home lab is not set up yet, use TryHackMe’s free Active Directory Basics room to explore a real AD environment in your browser without installing anything locally.

Target: tryhackme.com/room/activedirectorybasics

Steps:
1. Create a free TryHackMe account if you do not have one
2. Join the “Active Directory Basics” room
3. Deploy the machine and connect via TryHackMe’s browser-based AttackBox
4. Follow the room tasks — answer each question as you complete it
5. Note the AD structure, the OU layout, and the domain controller hostname

TryHackMe is an authorised learning platform. All testing happens within their controlled environment. This room complements today’s theory perfectly.

✅ What you just learned: Seeing a real AD structure in an interactive environment makes the forest/domain/OU hierarchy tangible. The structure you see in TryHackMe is virtually identical to what you will encounter in real enterprise environments — the same OU names, the same group structures, the same FSMO roles.

📸 Screenshot your completed TryHackMe room certificate and share it in #day23-lab on Discord.


First LDAP and SMB Enumeration Commands from Kali

Once your AD lab is running and Kali Linux is on the same host-only network, you are ready to run your first real enumeration commands. These are the exact commands I run in the first ten minutes of every AD engagement. Understanding the output they produce is the foundation for every attack in Days 24–31.

securityelites.com
┌──(mr_elite㉿kali)-[~]
└─$ enum4linux -a dc01.lab.local 2>/dev/null | head -40

Starting enum4linux v0.9.1 ( http://labs.portcullis.co.uk/application/enum4linux/ )

[*] Performing Share Enumeration on dc01.lab.local
Sharename Type Comment
——— —- ——-
ADMIN$ Disk Remote Admin
C$ Disk Default share
IPC$ IPC Remote IPC
NETLOGON Disk Logon server share
SYSVOL Disk Logon server share

[*] Enumerating Workgroup/Domain on dc01.lab.local
Domain Name: LAB
Domain Sid: S-1-5-21-3623811015-3361044348-30300820

[*] Getting domain SID for dc01.lab.local
Domain Member: True
Domain SID: S-1-5-21-3623811015-3361044348-30300820

[+] Users: asmith, bjones, sqlsvc, Administrator

📸 enum4linux output against the lab domain controller — confirms shares (SYSVOL/NETLOGON are always present), domain SID, and a user list in one command
KALI — First AD Enumeration Commands
# STEP 1 — Verify DC is reachable from Kali
ping dc01.lab.local
nmap -p 389,445,88,3268 dc01.lab.local
# Ports: 389=LDAP, 445=SMB, 88=Kerberos, 3268=Global Catalog

# STEP 2 — Anonymous LDAP enumeration (no credentials)
ldapsearch -H ldap://dc01.lab.local -x -b “dc=lab,dc=local” -s sub “(objectclass=*)” 2>/dev/null | head -60

# STEP 3 — Enumerate users via anonymous SMB
enum4linux -a dc01.lab.local

# STEP 4 — Enumerate with credentials (once you have domain creds)
ldapsearch -H ldap://dc01.lab.local -x -D “LAB\asmith” -w “Password123!” \
-b “dc=lab,dc=local” “(objectclass=user)” sAMAccountName description

# STEP 5 — Query password policy (critical before spraying)
crackmapexec smb dc01.lab.local -u “” -p “” –pass-pol 2>/dev/null

# STEP 6 — Enumerate SPNs for Kerberoasting (requires any domain user)
python3 /usr/share/doc/python3-impacket/examples/GetUserSPNs.py \
lab.local/asmith:Password123! -dc-ip 192.168.56.10 -request

🔥 EXERCISE 3 — KALI LINUX TERMINAL (AD LAB)
Run your first complete AD enumeration against your lab domain controller

⏱️ Time: 20–30 minutes · Target: Your lab DC (lab.local) on host-only network

With your AD lab running, execute the following complete enumeration sequence from Kali Linux. Document everything you find.

COMPLETE LAB ENUMERATION
# Replace 192.168.56.10 with your DC’s IP
DC_IP=”192.168.56.10″
DOMAIN=”lab.local”

# Run all first-stage enumeration
nmap -p 88,389,445,3268 -sV $DC_IP -oN nmap-dc.txt
enum4linux -a $DC_IP 2>/dev/null | tee enum4linux-output.txt
crackmapexec smb $DC_IP -u “” -p “” 2>/dev/null

# With lab credentials (use asmith / Password123!):
crackmapexec smb $DC_IP -u “asmith” -p “Password123!” –users 2>/dev/null
crackmapexec smb $DC_IP -u “asmith” -p “Password123!” –groups 2>/dev/null
crackmapexec smb $DC_IP -u “asmith” -p “Password123!” –shares 2>/dev/null

# Check for Kerberoastable SPNs:
python3 /usr/share/doc/python3-impacket/examples/GetUserSPNs.py \
$DOMAIN/asmith:Password123! -dc-ip $DC_IP 2>/dev/null

Document: How many users found? What shares are visible? Are there any SPNs (service accounts)? What is the password policy lockout threshold?

✅ What you just learned: In under five minutes of enumeration you have the domain user list, password policy (critical for safe spraying), share list, and a list of Kerberoastable service accounts — everything needed to plan the next phase of the attack chain. This is the exact output a real penetration test report’s reconnaissance section would contain.

📸 Screenshot your enum4linux user list and share it in #day23-enum on Discord. Tag #ethicalhackingday23

🧠 QUICK CHECK — Section 6

Why is querying the password policy before password spraying critically important?




📋 Commands Used Today — Day 23 Reference

nmap -p 88,389,445,3268 DC_IPVerify DC is reachable and confirm AD port profile
enum4linux -a DC_IPFull SMB/RPC enumeration — users, shares, groups, password policy
ldapsearch -H ldap://DC -x -b “dc=lab,dc=local”Anonymous LDAP query for domain objects
crackmapexec smb DC -u user -p pass –usersAuthenticated SMB user enumeration
GetUserSPNs.py domain/user:pass -dc-ip DCEnumerate Kerberoastable service accounts
Install-ADDSForest -DomainName lab.localPowerShell — promote Windows Server to Domain Controller
New-ADUser -Name … -SamAccountName …PowerShell — create lab user accounts
setspn -A MSSQLSvc/dc01:1433 LAB\sqlsvcRegister an SPN on a service account for Kerberoasting practice

🏆 Mark Day 23 as Complete

You have entered enterprise territory. Lock in your progress.


❓ Frequently Asked Questions

What is Active Directory and why is it important for ethical hacking?
Active Directory is Microsoft’s enterprise directory service used by approximately 90% of Fortune 500 companies to manage users, computers and policies. For ethical hackers, it is the primary target in enterprise engagements because compromising a Domain Controller grants access to every system, every credential, and every resource in the domain.
What is the difference between a forest and a domain?
A domain is the basic AD unit — a collection of objects (users, computers, groups) sharing one directory database and one set of administrators. A forest is the top-level container that holds one or more domains. The forest root domain hosts the Schema Master and Domain Naming Master FSMO roles. Compromising the forest root means Enterprise Admin — above even Domain Admin.
How do ethical hackers enumerate Active Directory?
Primary tools include: BloodHound/SharpHound for attack path mapping, PowerView for PowerShell-based AD enumeration, ldapsearch for raw LDAP queries, enum4linux for SMB and RPC enumeration, CrackMapExec for multi-protocol authenticated enumeration, and Kerbrute for username enumeration via Kerberos. These are introduced progressively from Day 24 onwards.
How do I build a free Active Directory lab at home?
Download the free 180-day Windows Server 2022 evaluation ISO from Microsoft’s evaluation centre. Install in VirtualBox on an isolated host-only network. Promote to a domain controller using PowerShell (Install-ADDSForest), create lab users and a service account with an SPN, join a Windows 10 evaluation VM to the domain, add Kali Linux to the same network. Total cost: zero.
What is Kerberos and why is it central to AD attacks?
Kerberos is the primary AD authentication protocol that uses encrypted tickets instead of transmitting passwords. Every major AD attack — Kerberoasting, AS-REP Roasting, Pass the Ticket, Golden Ticket — exploits specific weaknesses in how Kerberos tickets are issued, encrypted, or validated. Day 25 covers these techniques in full practical depth.
What should I do after completing today’s lab setup?
Verify that: your DC is accessible from Kali by IP and hostname, enum4linux returns user and share data, and you can see the sqlsvc account’s SPN with GetUserSPNs.py. Once those three checks pass, you are fully prepared for Day 24’s Active Directory attack techniques. The lab will be your practice environment through Day 31.

← Previous

Day 22: Exploitation Beyond Metasploit

Next →

Day 24: Active Directory Attacks

📚 Further Reading

ME
Mr Elite
Owner, SecurityElites.com · Top 0.001% Ethical Hacking Trainer
I have been running Active Directory penetration tests professionally since 2015. The first time I achieved Domain Admin on a real enterprise engagement, it was not through a zero-day or a sophisticated exploit — it was through a service account with a weak password, a Kerberoasting attack, and a single lateral movement step to a machine where a Domain Admin had logged in that morning. That experience shaped my entire philosophy: AD attacks are methodical, not magical. If you follow the five-step chain, enumerate carefully, and understand Kerberos at the ticket level, Domain Admin is consistently achievable. This course gives you every step in that chain, starting tomorrow with Day 24.

LEAVE A REPLY

Please enter your comment!
Please enter your name here