Skip to content

Latest commit

ย 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฐ Active Directory Home Lab

Every morning at a Fortune 50 financial institution I'd log into my laptop and see "AD: Authenticating..." flash across the screen. I always wondered โ€” what is that? Turns out it was Active Directory, the silent overlord of every corporate network, saying "You shall not pass" to anyone without valid credentials. So naturally, I built my own.

A fully functional enterprise-style Active Directory environment built from scratch inside VirtualBox โ€” Domain Controller, domain-joined client, Group Policy enforcement, PowerShell user management, and security audit logging.


๐Ÿ–ฅ๏ธ Lab Overview

Component Details
Domain lab.local / NetBIOS: LAB
Domain Controller DC01 โ€” Windows Server 2022 Standard
Client Machine CLIENT01 โ€” Windows 10
Hypervisor VirtualBox 7.2
Host Machine AMD Ryzen 7 5800XT, 16GB RAM
DC01 IP 192.168.10.1 (static)
CLIENT01 IP 192.168.10.10 (static)
Network VirtualBox Internal Network ADLab

๐Ÿ—๏ธ What Was Built

Phase 1 โ€” VM Setup & OS Installation

  • Created DC01 (2GB RAM, 2 vCPUs, 50GB dynamic disk) in VirtualBox
  • Configured dual network adapters: NAT (internet) + Internal Network ADLab
  • Installed Windows Server 2022 Standard Evaluation with Desktop Experience
  • Installed Windows 10 client (CLIENT01) on the same internal network

Phase 2 โ€” Static IP & Server Configuration

  • Renamed server to DC01 before promotion (critical โ€” name baked into domain)
  • Set static IP 192.168.10.1 on the Internal Network adapter
  • Configured DNS to 127.0.0.1 โ€” DC points to itself as DNS server

Phase 3 โ€” AD DS Role & Domain Promotion

  • Installed Active Directory Domain Services role via Server Manager
  • Dependencies installed: Group Policy Management, AD PowerShell Module, AD DS Snap-Ins
  • Promoted DC01 to Domain Controller โ€” created new forest lab.local
  • DNS role auto-installed alongside AD DS

Phase 4 โ€” Domain Verification

# Verified domain is fully operational
Get-ADDomain
# Returns: DNSRoot: lab.local, PDCEmulator: DC01.lab.local, NetBIOSName: LAB

Phase 5 โ€” CLIENT01 Domain Join

  • Configured CLIENT01 with static IP and DNS pointing to DC01
  • Verified connectivity: ping 192.168.10.1 โ€” 4/4 packets, 0% loss
  • Joined CLIENT01 to lab.local โ€” rebooted and logged in as LAB\Administrator
  • Verified with whoami โ†’ returned lab\administrator

๐Ÿ‘ฅ Active Directory Structure

lab.local/
โ”œโ”€โ”€ _USERS          โ†’ jsmith (John Smith), mlopez (Maria Lopez)
โ”œโ”€โ”€ _ADMINS         โ†’ itadmin (IT Admin)
โ”œโ”€โ”€ _GROUPS         โ†’ IT-Staff, HR-Staff, Helpdesk
โ””โ”€โ”€ _COMPUTERS      โ†’ CLIENT01

Security Groups & Membership

Group Members
IT-Staff itadmin
HR-Staff jsmith
Helpdesk mlopez

โšก PowerShell โ€” User Lifecycle Management

# Reset a user password
$pass = ConvertTo-SecureString "NewP@ss123" -AsPlainText -Force
Set-ADAccountPassword -Identity "jsmith" -Reset -NewPassword $pass

# Disable an account (offboarding)
Disable-ADAccount -Identity "jsmith"

# Re-enable an account
Enable-ADAccount -Identity "jsmith"

# Unlock a locked account
Unlock-ADAccount -Identity "jsmith"

# Check account status
Get-ADUser -Identity "jsmith" -Properties LockedOut, BadLogonCount |
    Select Name, Enabled, LockedOut, BadLogonCount

# Bulk create users from array
$users = @("tgrant","rchen","kpatel")
$password = ConvertTo-SecureString "P@ssword123" -AsPlainText -Force
foreach ($user in $users) {
    New-ADUser -Name $user -SamAccountName $user `
        -UserPrincipalName "$user@lab.local" `
        -Path "OU=_USERS,DC=lab,DC=local" `
        -AccountPassword $password -Enabled $true
}

# Find stale accounts (no login in 30+ days)
$cutoff = (Get-Date).AddDays(-30)
Get-ADUser -Filter {LastLogonDate -lt $cutoff -and Enabled -eq $true} `
    -Properties LastLogonDate | Select Name, LastLogonDate

๐Ÿ“‹ Group Policy Objects (GPOs)

1. Password Policy โ€” linked to lab.local

Setting Value
Minimum password length 10 characters
Password complexity Enabled
Maximum password age 90 days
Minimum password age 30 days
Password history 5 passwords remembered

2. User Restrictions โ€” linked to _USERS OU

Applies only to standard users. Admins are unaffected.

Policy State
Prohibit access to Control Panel Enabled
Prevent access to command prompt Enabled
Prevent access to registry editing tools Enabled

โœ… Verified: Logged in as jsmith on CLIENT01 โ€” Control Panel blocked with "This operation has been cancelled due to restrictions in effect on this computer." CMD blocked with "The command prompt has been disabled by your administrator."

3. Audit Policy โ€” linked to lab.local

Policy Setting
Audit account logon events Success, Failure
Audit account management Success, Failure
Audit logon events Success, Failure
Audit policy change Success, Failure

๐Ÿ”’ Security Audit Logging

Simulated Brute Force Attack

# Send 5 failed login attempts for jsmith
$i = 0
while ($i -lt 5) {
    net use \\DC01\IPC$ /user:LAB\jsmith wrongpassword 2>$null
    $i++
}

Query Failed Logins (Event ID 4625)

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625} |
    Select -First 5 | Format-List TimeCreated, Message

Critical Event IDs

Event ID Meaning Security Significance
4624 Successful logon Baseline for anomaly detection
4625 Failed logon Rapid failures = brute force
4634 Account logoff Session tracking
4720 User account created Unauthorized creation = insider threat
4740 Account locked out Lockout trigger โ€” often an attack

Result: Event Viewer captured 4,199 security events including the simulated failed logins. Event ID 4625 entries showed the exact account targeted, failure reason, source IP, and workstation โ€” identical to what a SOC analyst reads in a real Splunk alert.


๐Ÿ› ๏ธ Skills Demonstrated

Area Details
IT Infrastructure Built enterprise domain network from scratch in VirtualBox
Active Directory Domain creation, OU design, user/group management, domain join
Windows Server Server Manager, role installation, DNS, static IP configuration
PowerShell AD module โ€” user creation, password reset, bulk operations
Group Policy GPO creation, OU-scoped linking, policy verification
Networking Static IPs, DNS resolution, internal network design
Security & Auditing Audit policy, Event Viewer analysis, brute force simulation
Troubleshooting DNS failures, domain join errors, firewall rules
Virtualization VirtualBox VMs, snapshots, multi-VM networking
IAM Least privilege, delegation, account lockout, access control

๐Ÿ”ฎ Future Expansions

  • Second Domain Controller (DC02) for redundancy and failover
  • DHCP Server role โ€” dynamic IP assignment
  • File Server with shared drives and NTFS permissions
  • Splunk Universal Forwarder โ€” ship Event Logs to SIEM
  • Kali Linux VM โ€” AD enumeration and attack simulation
  • Fine-Grained Password Policies per security group
  • Remote Desktop Services โ€” RDP access control

๐Ÿ“„ Documentation

Full technical write-up available:

  • AD_Lab_Technical_WriteUp.pdf โ€” formatted project documentation with screenshots

๐Ÿ‘ค About

Luis Moreno โ€” Computer Engineer | IT Infrastructure & Cybersecurity

Pursuing MS in Computer Science (Cybersecurity concentration) at Arizona State University.
Actively targeting IT Support, Data Center, and Cybersecurity roles.


Built session by session, question by question โ€” not from a tutorial, but from actually understanding why each step mattered. Every error was a lesson. Every working command was a win.

About

Enterprise Active Directory home lab built: DC, GPOs, PowerShell user management, and security audit logging

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors