BUILD IT & BREAK IT LAB
Active Directory Lab (Part 1) — Windows Server 2022 Setup
Active Directory is essential to internal penetration testing as most organizations use it for their Windows infrastructure. As security professionals, we need to learn about this technology and understand the attacks that can be carried out against it.
In this post and the upcoming ones, we will learn more about Active Directory by building a lab environment. It will be part of the “Build it & Break it” series I plan to create. The series will take a specific technology, learn about its configuration, then explore types of attacks to perform against it.
To avoid this post becoming a lengthy thesis, I will divide it into parts; each part will go over setting up and configuring parts of the lab. Today’s post will cover the first part, setting up the Windows Server 2022.
With that being said, let’s proceed 🏃 🏃 🏃 🏃
Lab Requirements
- Virtualization Software (options can be Oracle Virtual Box, VMware Player, or VMware Workstation Pro)
- 1x Windows Server 2022. The evaluation copy can be found on the Microsoft Evaluation Center “Link”).
💡 Virtual Box and VMware Player are free to download.
Windows Server 2022 Setup
After downloading the ISO from the Microsoft Evaluation Center, we will create a new virtual machine; I am using VMware Workstation Pro for the lab.
The VM specifications:
- Processors: 2
- RAM: 2 GB
- Disk Size: a minimum of 20 GB
1. Create a new virtual machine by clicking on the “File” tab and “New Virtual Machine.” Then, choose the Typical (Recommended) option for a quick setup.
2. Click on the option “Installer disc image file (iso)” and select the ISO file we downloaded earlier. Then, choose the “Guest Operating System” type as Windows.
3. Next, we customize the VM “Hardware Specifications”. Since we are setting up a server with a heavier workload than a regular workstation, we will allocate two (2) virtual processors to ensure the server performs at a reasonable speed.
Also, we will give the VM “2 GB” of Memory, which is sufficient for the work we will do in the lab.
4. For the “Network” settings, we will have two (2) network adapters; one is connected to the outside internet, and the other is connected to the private lab network. This is a good practice to isolate the lab network from the home network.
- Adapter #1 — NAT connects to the internet
- Adapter #2 — VMNet0 connects to the private network lab
Go back to the Hardware setting, click on the “Network Adapter,” and select the NAT option for the first adapter. Also, ensure the “Connect at power on” is checked to enable the adapter when the machine starts.
After that, we add the second adapter for the private network by clicking on “Add” and selecting the “Network Adapter” option, then clicking “Finish” to add the adapter. Choose the “Custom” option on the network connection section to specify a specific virtual network.
💡 You can choose any network from the drop-down menu if it is not taken. I chose the first (VMNet0).
5. Now, power on the virtual machine. We will be greeted with this message “Press any key to boot from CD or DVD..” press “Enter” to load the Windows Installation files.
When the Operating System Wizard appears, click “Next,” then “Install Now” to begin the installation process.
6. The next step presents four (4) install choices; two are labeled “Desktop Experience,” which will provide you with a full graphical experience, and two are not. We will choose the second option “Standard Evaluation (Desktop Experience)” option.
💡 The difference between the two is explained below in the Guide to Windows Server Editions and Licensing by Stifter-Helfen.
The Standard edition is designed for small-to-medium-sized organizations that need no more than two instances of the server software in a virtual operating system.
The Datacenter edition is optimized for large-scale virtualization; its license allows one server to run an unlimited number of Windows Server instances.
7. Check the Microsoft Software License Terms box and click “Next.” Since we are installing the operating system from scratch, we will choose the “Custom” option and select the “Drive0 Unallocated Space” to install the system files.
💡 If you don’t see the drive, click the “Delete” button on each partition found, then click “Next.”
8. Shortly after that, Windows will begin installing the OS files; it usually takes a few minutes for the process to complete, after which the server will reboot itself to apply the configuration and settings needed.
When it is done, you will be presented with the “Customized Settings” screen to set up the local built-in Administrator password.
9. After logging into the server, we will start configuring a few things before installing Active Directory Services. First, adjust the Display resolution to fit our screen, click on the “Start” and then the “Settings” icons, and search Display.
10. Next, we will configure the two (2) network adapters we added in the first steps when creating the virtual machine. Go to the “Settings” page, click on the “Network and Internet” section, and then “Change Adapter Options.”
We will leave the first adapter, “Ethernet0,” untouched on the NAT network, which will get its IP address from your home router; mine is on the 192.168.223.0/24 subnet.
We will rename the adapters one to External and the other to Internal to distinguish between the networks.
11. For the Internal network adapter, I decided to have the Internal network in the 10.10.10.0/24 range. Therefore, I assigned the server an IP address of 10.10.10.5 and a subnet mask address of “255.255.255.0”.
The server IP will later be the domain controller after we install the Active Directory services and promote it. So, that’s why the Default Gateway is empty because the Domain Controller is going to be the gateway.
For the DNS, we assign it the DC address, which is 10.10.10.5, or a loopback of 127.0.0.1 so it pings itself. Both ways are correct.
12. After you complete the IP configuration, go to “Server Manager” and refresh the “Local Server” dashboard, you should be able to see the assigned IP for the server.
13. The following step is optional to change the “Time Zone” to your location. Time Zone is unnecessary; however, the server Time and Date are.
Since this server will be promoted to a domain controller, it is essential to have the server time and the workstations in sync with each other for Kerberos protocol to issue tickets.
14. The last step is to rename the server to something meaningful; since it will be the first domain controller in the domain, I called it “DC01”.
And restart the server to apply the changes.
15. After the reboot, log in to the server and check the changes were applied. Then, take a Snapshot of the machine with the current applied configuration.
🚨 It is very essential to have a Snapshot of the current VM state before installing Active Directory on it; just in case you messed up one of the steps, you can quickly revert to the initial state and work your way again from there.
You can always check the current Snapshot taken by clicking on the “Managing the Snapshots” icon.
That’s all for today. In the next post, we will work on installing the Active Directory services and configuring the DNS and DHCP services.
Thanks for stopping by …