https://browninfosecguy.com/Active-Directory-Lab-Setup-Tool

The AD Pentesting tool is a tool created in PowerShell to quickly setup an Active directory lab for testing purposes. This tool can help setup a Domain controller and Workstation in a lab environment quickly and effectively. While the tool is specifically written to configure an Active directory environment in a lab environment the tool can be easily stretched for production environment as its released under MIT license.

The process to manually configure a domain controller using GUI can be painful especially if you need to create and teardown the lab frequently. This single tool can not only configure a domain controller quickly but can also automate additional configuration such as creating share, creating users, and configuring group policy object for disabling Windows Defender which is something desirable especially in a lab environment.

This blog post will provide an overview of the tool and demonstrate how it can be used to automate configuring a domain controller and workstation.

The tool is a PowerShell script called “ADPentestLab.ps1” and is available on GitHub under MIT License.

There are few things to keep in mind before using the tool.

  1. This tool should be run as an Administrator.
  2. The tool takes the liberty to configure passwords where required without requiring user input. The password we configure is “Password1”, this can be easily changed if required.
  3. The tool was tested on a fresh install of Windows 2019 Server and Windows 10 Enterprise workstation.

When we run the tool, user is presented with following options:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/43b07986-ffaa-448e-baf8-3714fc455e7a/Diagram1.png

Figure 1: Basic Options of the Tool

As shown at ①, Option 1-5 are applicable to Server except option 3 which is applicable to both Server and workstation. Option 6 and 7 are exclusively for configuring workstation. Once you are done installing a Windows Server and Windows 10 Enterprise, you can use this tool for configuration. Figure 2 shows a fresh Windows 2019 server install.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/9901f471-0f9a-488e-b025-79fc5b68f58f/Diagram2.png

Figure 2: Windows 2019 Server

We begin by configuring the Domain Controller as shown in Figure 3. Option 1 allows us to assign our computer a new name and configure a static IP address. Although, not required it is always a good practice to name the computer to a more user-friendly name.

Important thing to note, when we display information about network interfaces, one can observe our machine has three interfaces, well one is loopback. Our lab set up has a virtual network using subnet 192.168.25.0/24 the other IP address 10.0.3.15 is from the NAT interface. Why is this important? because we need to configure our static IP address to correct interface. The displayed information will help us determine the correct Interface Index which we need to provide at ③. Also important is the Prefix length as shown at ⑤, we need to enter the length and not the subnet mask. Once we have provided the necessary configuration details the computer will be restarted.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/038908a7-b4cf-4dc6-9949-570dbbf72f77/Diagram3.png

Figure 3: Configuring Machine name and static IP