Setting Up Active Directory Lab: Part 1
Security and Pentest Home Lab Environment
π§± Active Directory Lab Overview
In this module, weβll configure a three-VM Active Directory (AD) lab:
- Domain Controller (DC) β Built using Windows Server 2019.
- Client VMs β Two instances of Windows 10 Enterprise.
Microsoft provides evaluation copies:
- Windows Server 2019 β 180-day license.
- Windows 10 Enterprise β 90-day license.
Note
These evaluation versions continue to function after expiration. To reset the trial period, create snapshots after setup and roll back when needed.
Tip
While one client is enough for most scenarios, some AD attacks require two clients. You can skip the second client based on your use case.
π₯ Downloading Windows ISO Files
πΉ Windows Server 2019
Visit: [Windows Server 2019 Microsoft Evaluation Center](https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2019?utm_source=chatgpt.com) - Download the 64-bit ISO (~5GB)
πΉ Windows 10 Enterprise
Visit: [Windows 10 Enterprise Microsoft Evaluation Center](https://www.microsoft.com/en-us/evalcenter/evaluate-windows-10-enterprise)
Reminder
Microsoft names ISO files using build numbers. Rename them for clarity.
ISO Name | OS Name |
---|---|
17763.3650...SERVER_EVAL_x64FRE_en-us | Windows Server 2019 |
19045.2006...CLIENTENTERPRISEEVAL_x64FRE_en-us | Windows 10 Enterprise |
Info
These builds were current as of December 2023. Yours may differ slightly.
π οΈ Creating the VMs
π₯οΈ Windows Server 2019 (Domain Controller)
- In VirtualBox, go to
Tools β New
. - Name the VM and set the Folder to your Home Lab directory.
- Select the Windows Server 2019 ISO.
- Check
Skip Unattended Installation
β ClickNext
. - Set Memory to
4096MB (4GB)
β ClickNext
. - Set Hard Drive to
100GB
β ClickNext
. - Review settings β Click
Finish
.
ποΈ Organizing the VM
- Right-click the VM β
Move to Group β [New]
- Rename the group to Active Directory
- Right-click the group β
Move to Group β Home Lab
π₯οΈ Windows 10 Enterprise (Client VM1)
- In VirtualBox, go to
Tools β New
. - Name the VM and set the Folder to your Home Lab directory.
- Select the Windows 10 Enterprise ISO.
- Check
Skip Unattended Installation
β ClickNext
. - Leave Memory and CPU at default β Click
Next
. - Set Hard Drive to
100GB
β ClickNext
. - Review settings β Click
Finish
.
ποΈ Organizing the VM
- Right-click the VM β
Move to Group β Home Lab/Active Directory
Afterwards it should look like this
π₯οΈ Creating Windows 10 Enterprise VM2
Follow the same steps used for Windows 10 Enterprise VM1
to create a second VM for the additional AD user.
π§© Grouping the VMs
Organize your VMs into logical groups for easier management and configuration.
βοΈ VM Configuration
π₯οΈ Windows Server 2019
- Select the
Windows Server 2019
VM β ClickSettings
. - Navigate to:
System
βMotherboard
- Boot Order:
- β Hard Disk
- β Optical
- β Floppy (Disable)
- Boot Order:
- Go to:
Network
βAdapter 1
- Attached to:
Internal Network
- Name:
LAN 2
- Click
OK
to save.
- Attached to:
π» Windows 10 Enterprise VM1
- Select
Windows 10 Enterprise VM1
β ClickSettings
. - Navigate to:
System
βMotherboard
- Boot Order:
- β Hard Disk
- β Optical
- β Floppy (Disable)
- Boot Order:
- Go to:
Network
βAdapter 1
- Attached to:
Internal Network
- Name:
LAN 2
- Click
OK
to save.
- Attached to:
π» Windows 10 Enterprise VM2
Repeat the same configuration steps as above for the second AD user VM.
π§± Windows Server 2019 Setup
πΏ OS Installation
- Start the
Windows Server 2019
VM. - Click
Next
βInstall now
. - Choose:
Windows Server 2019 Standalone Evaluation (Desktop Experience)
β ClickNext
. - Accept the license β Click
Next
. - Select:
Custom: Install Windows only (Advanced)
. - Choose
Disk 0
β ClickNext
. - The VM will reboot several times during installation.
π Initial Setup
- Set a password for the
Administrator
account β ClickFinish
. - Use
Right Ctrl + Delete
to access the login screen. - Log in with the password you set.
π‘ To view VirtualBox shortcuts:
File
βPreferences
βInput
βVirtual Machine
- Close the Windows Admin Center popup.
π¦ Guest Additions Installation
- From the VM toolbar:
Devices
βOptical Devices
βRemove disk from virtual drive
- Then:
Devices
βInsert Guest Additions CD image
- Open File Explorer β Click the mounted disk.
- Run
VBoxWindowsAdditions
(4th from bottom). - Click
Next
βNext
βNext
βInstall
. - Choose
Reboot now
β ClickFinish
. - After reboot, remove the Guest Additions disk.
- Use
Right Ctrl + F
to toggle fullscreen mode.
π Network Configuration
Since DHCP is disabled on AD_LAB
, assign a static IP:
- Right-click the network icon β
Open Network & Internet settings
- Click
Change adapter options
- Right-click
Ethernet
βProperties
- Select
Internet Protocol Version 4 (TCP/IPv4)
βProperties
Enter:
- IP address:
10.80.80.2
- Subnet mask:
255.255.255.0
- Default gateway:
10.80.80.1
- Preferred DNS:
10.80.80.2
- IP address:
- Click
OK
βOK
again β ClickYes
on the access prompt.
π₯οΈ Rename the Server
- Open
Settings
βSystem
βAbout
- Click
Rename this PC
β Enter a name β ClickNext
- Click
Restart now
to apply changes
π§ Install AD & DNS Roles
- Open
Server Manager
β ClickManage
βAdd Roles and Features
- Click
Next
untilServer Roles
- Enable:
Active Directory Domain Services
DNS Server
- Confirm with
Add Features
β ClickNext
βInstall
- After installation, click
Close
π·οΈ Promote to Domain Controller
- Click the flag icon β
Promote this server to a domain controller
- Select:
Add a new Forest
- Domain name:
ad.lab
- Domain name:
- Set a DSRM password β Click
Next
- Accept defaults β Click
Next
untilInstall
- Click
Install
β VM will reboot
π§ After reboot, login name will show as
AD_DOMAIN\Administrator
π DNS Forwarder Configuration
- Open Start β
Windows Administrative Tools
βDNS
- Select your server (e.g.,
DC1
) β Double-clickForwarders
- Click
Edit
β Add:10.80.80.1
(pfSense IP) - Click
OK
βApply
βOK
π‘ DHCP Installation
Since DHCP is disabled on the AD_LAB
interface, new devices wonβt receive IP addresses automatically. Weβll now enable the DHCP service on the Domain Controller to handle IP assignments for the AD_LAB
network.
- In
Server Manager
, clickManage
βAdd Roles and Features
- Click
Next
until you reach the Server Roles page - Enable
DHCP Server
β ClickAdd Features
- Continue clicking
Next
β On the Confirmation page, clickInstall
βοΈ DHCP Configuration
- After installation, click the flag icon in the toolbar β Select
Complete DHCP configuration
- Click
Commit
β ThenClose
π§ Define a New Scope
- Open
Start
βWindows Administrative Tools
βDHCP
- Expand your DHCP server (e.g.,
dc1.ad.lab
) - Right-click
IPv4
β SelectNew Scope
- Enter a Name and Description for the scope
π Scope Settings
- Start IP address:
10.80.80.11
Β - End IP address:
10.80.80.253
Β - Length:
24
Β - Subnet mask:
255.255.255.0
π‘ You can start from
10.80.80.3
if preferred. Reserving lower IPs allows for future static assignments.
- Leave Exclusions empty β Click
Next
- Set Lease Duration to
365 days
β ClickNext
π§ This ensures devices retain their IPs for a full year without renewal.
- Select
Yes, I want to configure these options now
β ClickNext
π Default Gateway
- Enter:
10.80.80.1
β ClickAdd
β ThenNext
Click
Next
through the DNS and WINS configuration pagesΒ Β Β (Weβre not using WINS in this setup)Select
Yes, I want to activate this scope now
β ClickNext
βFinish
β Summary
At this point, weβve completed the following:
- Installed Windows Server 2019
- Installed Guest Additions
- Promoted the server to a Domain Controller
- Configured DNS Forwarding
- Set up DHCP for the
AD_LAB
network
In the next part, weβll:
- Create Active Directory users
- Join Windows 10 clients to the domain