Skip to content
  • Twitter
  • Email
  • Home
  • About
  • Blog
  • Privacy Policy
Image for Spyware Titles

Security Sense

A Cybersecurity Blog

  • Physical Security
  • Cybersecurity
  • Tutorials
  • Toggle search form

How To Setup a Windows Active Directory Lab: Part 1

Posted on November 5, 2021July 25, 2022 By Kyle

Introduction

As either a Cybersecurity professional or Hobbyist it is absolutely essential to have access to a lab environment. There are many different approaches one can take to get this; platforms such as Hack The Box, TryHackMe, and other such places exist so we can have a safe place to practice and grow our skills. The other approach (and a little bit more involved) is to create your own environment. This is the method we will be working on for the next few days. Both approaches have their pros/cons and will depend on your goal. Me, personally, I am creating this environment so I can test a PowerShell script for a project that I am currently working on. I also plan on utilizing this environment in the future so I can practice Active Directory attacks and executing my very own malicious PowerShell scripts. Remember as a cyber professional/hobbyist, it is essential to understand attacks to understand defense!

Environment consists of:

  • Windows 2019 Server – DC
  • Windows 2019 Server – FS (OPTIONAL)
  • Windows 10 Workstation

NOTE: I originally built this environment to test and run PowerShell scripts for a project that I am currently assigned to. If you want to build out this environment for hacking purposes, I will be writing up an additional blog to place a machine in the network. This future article will consist of downloading and installing Kali Linux as well as setting up the network properly.

Recommended Specs:

  • 80 GBs of Disk Space (20 Per Machine)
  • 16 GB of Ram ( 2GB per Guest and rest for Host)

Required Software:

  • VirtualBox running on your Host Machine
  • ISO files for Windows Server and for Windows 10.
 

This tutorial will be utilizing VirtualBox to setup the Active Directory (AD) environment. Any other virtualization software will be out of scope for this tutorial. Don’t fret, this first post will just be the initial setup of the VirtualBox environment. Part 2 will cover the actual Windows Installation, Domain Controller (DC), File Server (FS), and Workstation (WS) setup. If you prefer to use VMware or Hyper-V then you can just pick up at part 2. For the rest of you, let us continue!

VirtualBox Installation

As with nearly every topic in IT, everyone has their own preference and opinion on software. Some of you probably think I am trash just because we are using VirtualBox. But as you will find out if you keep coming back to my page, I always prefer software that is free and open-source. With that being said, lets get started. Go to the official site (Oracle VM VirtualBox) and click on the Download link in the left side bar. Once you are there you will see “VirtualBox $latestVersion Platform Packages:”. I am on windows, so I will be clicking “Windows Hosts”. This will prompt a download of an .exe file. Allow it to download and when ready execute it.

VirtualBox Download Page

Run through the installation with all default settings. There is no reason to make things more complicated than they should be. Once you’ve clicked all the “Yes” and “Next” buttons on the installation wizard, the program will begin to install. While that is happening go back to the VirtualBox download page and also download the Extension Pack. This will begin to download to your default download folder. By this time VirtualBox should have installed. Ensure the “Start Oracle…” box is checked and click Finish. The VirtualBox Manager should pop up.

NOTE: If your installing a fresh copy of VirtualBox you won’t have all these VMs on the left hand side.

Once you have opened up the VB manager, go back to your downloads and double click the extension pack download. Once again go through and default the entire installation. I.E. accept the AU agreement and Next it all. You will finally get a message that you have successfully installed the Extension Pack. Next we will begin setting up the Virtual Machines in the VB Manager.

 

Building the Virtual Machines

I kind of breezed through the first part and I apologize to you for that. I kind of figured that most of you would have either installed it already, or would know how. It’s very easy, literally just default the entire installation. I promise for this section I will break it down Barney Style and provide a suitable amount of screenshots. I know I love pictures in these things.

So, first and foremost we need images (.ISO) files for our servers and workstations. For those of you that don’t know what that is or need a refresher, go here. It’s a How To Geek Article on what they are and how they are used in computing. In the most layman sense, they are the files that allow you to install operating systems on physical or virtual machines. While typically burned onto CDs for installation, we will be virtualizing everything, including our CD drive.

It took me a while to find free Windows ISO files but eventually I discovered the Microsoft Evaluation Center. Here Microsoft lets you download Evaluation copies of their operating systems. Have no fear, for our use you can have use it forever! Once you have navigated to the Evaluation Center, go to products and choose Windows Server 2019. As a note you can install any version of Win Server. You have to do a little searching but you can find older versions such as 2012 R2, 2008, etc. Click the ISO radio button and press “Continue”.

Next input all fake info.. it doesn’t matter.

 

Once you press Continue, select your language, and click download. Wait for the ISO file to install. Repeat the same steps for the Windows 10 Enterprise ISO (Choose x64 radio button when asked to select your platform).

 

 

Once both ISO files have downloaded open up your Virtual Box application and click the blue star object that says “New”.

 


 

We will be installing our first instance of Windows Server 2019 first. Indicate in your title that this will be our Domain Controller. I named mine WinHackEnv-DC. Also ensure you have selected “Microsoft Windows” for Type and “Windows 2019 64-bit” for version. For the Machine Folder most of you can just save it in the default location. As for me, I have a dedicated drive just for my Virtual Machines.

 

 

Click on the “Next” button. We will now select the amount of memory to dedicate to the VM. Since we put in Windows 2019, VirtualBox has by default assigned it 2048 MB or 2.048 GB. We will keep this default and select “Next”.

 

On the next screen the “Create a Virtual Hard Disk Now” radio button should be selected. If it is not, please select that and click “Create”.

 

 

The next window will have you create the virtual hard disk. For this tutorial we will be keeping this at the default “VDI”. For all you Nerds out there that are curious, these options are offered for cross-platform compatibility.  VHD is Microsoft’s VM format for Hyper-V while VMDK is VMWare’s format for their virtualization software. So click Next and we will move on.

 


This next window has us specify certain settings on our virtual disk. We will be selecting the default option, “Dynamically Allocate”. Click the Next button.

Now we will set the File Location and Size, just like the rest of the windows, we will go with the default options. Click “Create”!

 


Just to point out, as long as you set the Type and Version correctly in the beginning,  the rest is essentially all default options. You should be back at the VB Manager Screen. The VM that has now appeared in the left column should be thought of as a shell. Not a command terminal, but like a hard casing with nothing in it. We have just setup the shell of the VM. We haven’t configured the VM settings or installed the server. Next we will edit the VM settings. In order to do this ensure the WinHackEnv-DC virtual machine is selected and click the yellow “Settings” icon at the top.

We will be editing the VM’s settings as well as adding our ISO file to the optical drive. First go to System settings and uncheck “Floppy” in the Boot Order table. You can then use the arrows to move “Floppy” to the bottom, but it won’t matter.

Verify our VM’s network settings, go to the Network Tab and ensure “Host-Only Adapter” is selected.

Now navigate to “Storage” and in the Storage Devices box, click on the entry that says “Empty”. Now in the Attributes column click the optical disk icon (also has a little black arrow pointing down) and a menu will appear. Click the option “Choose a disk file…”

Select the 2019 Server ISO. Click open. Once you return to the VM Settings window. Click OK and you will now be back at the VirtualBox Manager.

Now your DC will boot the ISO file and you will be able to install a fresh copy of Windows Server. But before we do that, we are going to create our other Virtual Machines. First, we will start with our other server. I will be following similar nomenclature and am naming it WinHackEnv-FS. This will act as my network’s File Server. The File Server setup will be an exact repeat of the DC (minus the name.. duh). Go back and reference them if you do not remember exactly what we did.

NOTE: If you are trying to save room on your PC or just don’t have enough memory, you do not have to install the File Server. You can still simulate a Windows Active Directory with a Domain Controller and at least one workstation.

 
Once you have setup the File Server VM , edited the boot order settings appropriately, and added the 2019 Server ISO, we will begin the last VM. This last one we will be building will be named WinHackEnv-WS. The WS stands for Workstation. 
 
Click the New Icon on the Virtual Box Manager in order to start. The setup for this will be SLIGHTLY different than the previous two servers. The biggest differences will be the Version that is selected on the Name and Operating System window, as well as the ISO you will be choosing. So on the current window, select Windows 10 as the Version.
 
 
 
Go through the setup selecting all the default values, just like we did in all the previous steps. This should take you up to where the VM is built, and you are back at the Virtual Box Manager. Highlight your Workstation VM and go to settings. Change the boot order settings to reflect the other previous servers. Then navigate to storage but select the Workstation ISO for the optical drive.
 

 
Click “Open” the “Ok” on the Settings Panel. You should be back at the VB Manager. Thus leading us to the end of our post! Sorry I had to split this up into multiple posts. I really would have liked to keep it in one. Unfortunately what we are doing is rather setup intensive. In future posts I can cover easier setups using vulnerable VMs like Metasploitable and OWASP’s Broken Web Apps. You can look those up on your own if your too curious. Later all!
 
 

 

Cybersecurity, Tutorials Tags:Active directory, cybersecurity lab, training

Post navigation

Next Post: How to Setup a Windows Active Directory Lab – Part 2

Copyright © 2025 Security Sense.

Powered by PressBook WordPress theme