BUILD IT & BREAK IT LAB

Active Directory Lab (Part 1) — Windows Server 2022 Setup

Nairuz Abulhul
R3d Buck3T
Published in
8 min readDec 12, 2022

--

Photo by Sean Whelan on Unsplash

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

💡 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.

Figures 1 & 2 — show creating a New Virtual Machine on VMware Workstation Pro.

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.

Figures 3 & 4 — show selecting the server 2022 ISO and choosing Windows as the operating system type.

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.

Figure 5 — shows customizing the CPU and Memory requirements — https://medium.com/r3d-buck3t
Figure 5 — shows customizing the CPU and Memory requirements.

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.

Figure 6 — shows the setting up of the first network adapter for the NAT network.

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).

Figures 7, 8 & 9 — show the process of setting up multiple network adapters within the VMware Workstation environment.

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.

Figures 10, 11 & 12 — show the initial Installation messages.

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.

Figure 13 — shows selecting the second option “Standard Evaluation (Desktop Experience)” option. https://medium.com/r3d-buck3t
Figure 13 — shows selecting 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.”

Figures 14, 15 & 16 — show the Microsoft license and disk partitioning screens.

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.

Figures 17 & 18 — show Windows begins the installation process and after the reboot screen.

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.

Figures 18, 19 & 20— show adjusting the machine display resolution to fit the screen.

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.

Figures 20 & 21 — show renaming the NAT network to External (internet).

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.

Figures 22, 23 & 24 — show setting up the internal private network.

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.

Figure 25- shows the Internal network IP is assigned to 10.10.10.5. https://medium.com/r3d-buck3t
Figure 25- shows the Internal network IP is assigned to 10.10.10.5.

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.

Figure 26 — shows changing the server Time Zone. https://medium.com/r3d-buck3t
Figure 26 — shows changing the server Time Zone.

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.

Figures 27, 28 & 29 — show the steps to rename the server computer name.

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.

Figures 30 & 31 — show the steps to take a Snapshot of the current VM state.

You can always check the current Snapshot taken by clicking on the “Managing the Snapshots” icon.

Figure 32 — shows the VM Snapshot. https://medium.com/r3d-buck3t
Figure 32 — shows verifying the VM Snapshot was taken.

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 …

--

Nairuz Abulhul
R3d Buck3T

I spend 70% of the time reading security stuff and 30% trying to make it work !!! aka Pentester [+] Publication: R3d Buck3T