⚡ Intermediate
Active Directory Lab Setup
Build your own Active Directory environment for practicing domain attacks, Kerberos exploitation, and privilege escalation techniques.
Resource Requirements
An AD lab requires significant resources: at least 16GB RAM for DC + 1 workstation,
32GB+ recommended for multi-machine environments. Use SSDs for better performance.
Lab Architecture
Basic AD Lab Setup
Required VMs
DC01 - Domain Controller
- OS: Windows Server 2019/2022
- RAM: 4GB minimum
- Disk: 60GB
- Roles: AD DS, DNS, DHCP (optional)
- IP: 10.0.0.10 (static)
WS01/WS02 - Workstations
- OS: Windows 10/11 Pro/Enterprise
- RAM: 2-4GB each
- Disk: 40GB each
- Domain joined: Yes
- IP: DHCP or static
Step 1: Domain Controller Setup
1.1 Install Windows Server
- Create VM with 4GB RAM, 60GB disk
- Install Windows Server 2019/2022 (Desktop Experience)
- Set static IP: 10.0.0.10, Gateway: 10.0.0.1, DNS: 127.0.0.1
- Rename computer to DC01
- Disable Windows Firewall (for lab only!)
1.2 Install AD DS Role
powershell
# PowerShell - Install AD DS
Install-WindowsFeature AD-Domain-Services -IncludeManagementTools
# Promote to Domain Controller
Install-ADDSForest -DomainName "lab.local" -DomainNetBIOSName "LAB" -InstallDNS -SafeModeAdministratorPassword (ConvertTo-SecureString "P@ssw0rd123!" -AsPlainText -Force) -ForceServer will reboot after promotion completes.
1.3 Create Vulnerable Configuration
powershell
# Create OUs
New-ADOrganizationalUnit -Name "Corp" -Path "DC=lab,DC=local"
New-ADOrganizationalUnit -Name "Users" -Path "OU=Corp,DC=lab,DC=local"
New-ADOrganizationalUnit -Name "Groups" -Path "OU=Corp,DC=lab,DC=local"
New-ADOrganizationalUnit -Name "Computers" -Path "OU=Corp,DC=lab,DC=local"
New-ADOrganizationalUnit -Name "Service Accounts" -Path "OU=Corp,DC=lab,DC=local"
# Create Users with weak passwords (for testing)
$password = ConvertTo-SecureString "Password123!" -AsPlainText -Force
New-ADUser -Name "John Smith" -SamAccountName "jsmith" -UserPrincipalName "jsmith@lab.local" -Path "OU=Users,OU=Corp,DC=lab,DC=local" -AccountPassword $password -Enabled $true
New-ADUser -Name "Admin User" -SamAccountName "admin.user" -UserPrincipalName "admin.user@lab.local" -Path "OU=Users,OU=Corp,DC=lab,DC=local" -AccountPassword $password -Enabled $true
# Create a Kerberoastable service account
New-ADUser -Name "SQL Service" -SamAccountName "svc_sql" -UserPrincipalName "svc_sql@lab.local" -Path "OU=Service Accounts,OU=Corp,DC=lab,DC=local" -AccountPassword $password -Enabled $true -ServicePrincipalNames "MSSQLSvc/sql.lab.local:1433"
# Create AS-REP Roastable user (no pre-auth)
Set-ADAccountControl -Identity "jsmith" -DoesNotRequirePreAuth $true
# Add admin.user to Domain Admins
Add-ADGroupMember -Identity "Domain Admins" -Members "admin.user"Step 2: Workstation Setup
powershell
# Set DNS to DC
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 10.0.0.10
# Join domain
Add-Computer -DomainName "lab.local" -Credential LAB\Administrator -Restart
# After restart, add local admin (run as domain admin)
Add-LocalGroupMember -Group "Administrators" -Member "LAB\jsmith"
# Enable WinRM for remote attacks
Enable-PSRemoting -Force
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -ForceStep 3: Add Vulnerable Configurations
Lab Only!
These configurations are intentionally vulnerable. Never apply them to production environments.
Unconstrained Delegation
powershell
# On DC - Enable on WS01
Set-ADComputer -Identity "WS01" -TrustedForDelegation $trueWeak GPO Permissions
powershell
# Allow jsmith to edit Default Domain Policy
Set-GPPermission -Name "Default Domain Policy" -TargetName "jsmith" -TargetType User -PermissionLevel GpoEditDCSync Rights
powershell
# Grant DCSync to admin.user
Add-ADPermission -Identity "DC=lab,DC=local" -User "admin.user" -Rights ExtendedRight -ExtendedRights "Replicating Directory Changes All"LLMNR/NBT-NS Enabled
Leave default - these are enabled by default and vulnerable to poisoning attacks.
Automated Lab Builders
DVAD - Deployable Vulnerable AD
Terraform scripts to deploy vulnerable AD labs in cloud or locally.
GitHub →DetectionLab
Lab with logging/SIEM for practicing detection alongside attacks.
detectionlab.network →