PEH (Practical Ethical Hacking) — Setting Up the Domain Controller on VirtualBox
This is a step-by-step guide for configuring a Domain Controller on VirtualBox.
It is a crucial setup for the PEH course’s Active Directory labs, as this setup paves the way for all the subsequent modules where attack vectors and mitigations are taught in an Active Directory context.
Important Warning
⚠ This guide provides instructions for configuring a Domain Controller specifically tailored for the PEH course labs. It is intentionally set up with vulnerabilities for educational purposes and should NOT be used in a production environment. ⚠
Pre-requisites
- 16GB of RAM
- VirtualBox
- Windows Server 2022 64-bit ISO
VirtualBox Network Setup
First of all, all lab machines must be attached to the NatNetwork
network. NAT, orNetwork Address Translation, serves as a localized virtual network within our labs, enabling the isolation of individual machines within a dedicated network.
This configuration ensures internet access for these machines while shielding them from external access.
Configuration steps:
- Navigate to Tools→ Network → NAT Networks.
- Set the CIDR to →
192.168.57.0/24
. - Ensure that all lab machines are configured to use the
NATNetwork
as their designated network.
Getting the ISO for the virtual machine
To set up the lab environment, you’ll need the following virtual machine image. Simply follow the provided link and fill out the form to unlock the download of the ISO (Please note that providing real data in the form is not necessary).
Windows Server 2022 Trial (microsoft.com)
Download the 64-bit edition
Creating a New Box
On VirtualBox, create a new box and use the following configuration parameters:
- Type =
Microsoft Windows
- Version =
Windows 2016 (64-bit)
- Hardware = Minimum of 4GB of RAM
- 1 processor is fine
- Disk Size = 60GB
Before initializing the machine, setup the ISO:
Operating System Setup
When you first boot the server you’ll have to install the operating system and configure a few things.
The first step is to pick the language that you prefer and then proceed to the installation page. Click on install and continue till you reach this stage:
Ensure you pick Windows Server 2022 Standard Evaluation (Desktop Experience)
to have a GUI.
Afterwards, pick the Custom Install
option, and proceed to add a new partition.
Keep the default values provided during this step.
If you observe only two partitions (instead of 3), it’s fine.
After this step you’ll be prompted to insert the Administrator
password.
I’ll stick with the password that Heat used, so let’s go with P@$$word!
.
After this step, you will be able to login into the server with the Administrator credentials!
Rename The Machine
Before proceeding with the Domain Controller setup, let’s rename this machine to HYDRA-DC
. This will help us in the next labs during our reconnaissance phase to easily identify the domain controller.
Type on the windows search bar “name” and click on View your PC name
:
Configuring the Domain Controller
Now we are ready for the most important part of the setup, setting up the Domain Controller that we will be attacking on the next labs! Let’s head over the Server Manager Dashboard (it should open automatically as soon as the server boots up).
- Open Server Manager > Manage >
Add Roles and Features
2. A new wizard will pop up:
Add Roles and Features setup
- Before you Begin > Next.
- Installation type >
Role-based or feature-based installation
- Server Selection > Next (HYDRA-DC should be selected).
- Server Roles >Click on
Active Directory Domain Services
checkbox (see below image 1) > Click on “Add Features
". - Features > Next.
- AD DS > Next.
- Confirmation > Install.
- When the installation is ready, click on
Promote this server to a domain controller
:
After clicking on Promote this server to a domain controller
, a new wizard will open up. Proceed with the following options:
- Deployment Configuration > Select the
Add a new forest
option and set the Root domain name =MARVEL.local
- Domain Controller Options > Keep default configurations, just set the password
P@$$word!
- DNS Options > Next.
- Additional Options (Should set MARVEL automatically) > Next.
- Paths > Next.
- Review Options > Next.
- Prerequisites Check (You should see “All prerequisites checks passed successfully) > Install.
- Await for the installation to complete and reboot the machine.
Login as MARVEL\Administrator
By now, after the reboot you should be seeing this screen:
This means that we will be logging for the first time into the MARVEL Domain!
Now there is just one last thing missing to setup in order to unlock another few attack vectors.
Setup Certificate Services
Again let’s head over the Server Manager. Manage > Add Roles and Features
- Before you Begin > Next.
- Installation Type >
Role-based or feature-based installation.
- Server Selection > Next.
- Server Roles >Check the
Active Directory Certificate Services
checkbox > click on “Add Features” - Features > Next.
- AD CS > Next.
- AD CS > Role Services > Make sure that
Certification Authority
is checked > Next. - Confirmation > Check the
Restart the destination server automatically if required
checkbox > Install. - Await for the installation and then click on
Configure Active Directory Certificate Services on the destination server
Configure Credentials Setup
- Credentials > should be set to
MARVEL\\Administrator
> Next. - Role Services > Click on the
Certification Authority
checkbox. - Setup Type >
Enterprise CA
- CA Type >
Root CA
- Private Key > Pick the
Create a new private key
option - Cryptography (keep default SHA256) > Next.
- CA Name > Next.
- Validity Period > change to 99 years.
- Certification Database > Next.
- Confirmation > Configure.
After completing the configuration, reboot the server.
Conclusion
Great job! Your Domain Controller is up and running on VirtualBox, and now the only remaining step is to add the users and groups. All the details for this step are covered in the video “Setting Up Users, Groups, and Policies”.
Once you’ve set up the users, groups and the windows machines, you’ll be ready to delve into exploring various attack vectors and their mitigations within the Active Directory environment! 🚀