You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this post, I'll walk you through setting up my personal homelab - a project that serves both as a hands-on learning experience and as a future reference. While this documentation is partly a note to my future self, it's also a guide for anyone interested in gaining a deeper understanding of system administration, including networking, firewall configuration, and policy management. Ultimately, the goal is to create an environment where I can safely experiment with Active Directory (AD) misconfigurations and vulnerabilities, culminating in a simulated attack on my own lab.
12
12
13
-
# Network Setup
13
+
##Network Setup
14
14
The backbone of this homelab is a segmented network architecture that isolates various virtual machines (VMs) from my home network using a firewall. We'll use pfSense as our firewall solution and Proxmox for managing the VMs. I’ll keep the initial setup straightforward, focusing on getting the basic system up and running. Here’s a schematic overview of the homelab architecture:
@@ -34,7 +34,7 @@ To ensure smooth operation, here’s what you’ll need:
34
34
- 250GB of disk space
35
35
- A bootable Proxmox VE drive (ISO)
36
36
37
-
# Proxmox Setup
37
+
##Proxmox Setup
38
38
Installing Proxmox is relatively simple, so I’ll skip the step-by-step details but you can go ahead and follow their official [Getting Started](https://www.proxmox.com/en/products/proxmox-virtual-environment/get-started). After a successful installation, you should be able to access the login portal via the IP address you specified.
@@ -47,7 +47,7 @@ For better organization, consider creating new pools for your networks. This can
47
47
48
48
To upload ISOs to Proxmox go to `lab > local (lab) > ISO Images > Upload`.
49
49
50
-
## Setting Up PfSense
50
+
###Setting Up PfSense
51
51
Download the [latest stable ISO](https://www.pfsense.org/download/) of pfSense and create a new VM in Proxmox by clicking the blue box in the top right corner. Select the uploaded pfSense ISO and proceed with the default settings.
52
52
53
53
After creating the VM, assign it to our previously created bridge interfaces by going to `Hardware > Add Network Device` and selecting `vmbr1`. Repeat this process for `vmbr2` and `vmbr3`.
@@ -113,7 +113,7 @@ We do not setup DHCP as we will let the Domain Controller handle this for us lat
113
113
114
114
After setting up pfSense, you can create new hosts and assign them the `vmbr1` NIC on the LAN. From any host on the `172.16.0.1/24` network, you can access the pfSense web interface for further configuration.
115
115
116
-
### Configuring Firewall Rules
116
+
####Configuring Firewall Rules
117
117
Let’s set up some basic firewall rules to control traffic between our networks and the outside world. Log into the pfSense dashboard using the credentials `admin:pfsense` and change the following settings during the setup process:
118
118
- Step 2: Uncheck override DNS
119
119
- Step 4: Uncheck the `Block private networks from entering via WAN` option. Because this is not a real WAN.
@@ -132,7 +132,7 @@ Next go to `Firewall > Aliases` and make a new alias with the following options:
132
132
- Network 4: `169.254.0.0/16`
133
133
- Network 5: `127.0.0.0/8`
134
134
135
-
### WAN Rules
135
+
####WAN Rules
136
136
Go to `Firewall > Rules > WAN > Add` and make a new rule with the following options:
137
137
- Action: `Pass`
138
138
- Address Family: `Ipv4`
@@ -143,7 +143,7 @@ Go to `Firewall > Rules > WAN > Add` and make a new rule with the following opti
143
143
144
144
Replace the `<pfSense IP>` field with the real internal IP address of the pfSense VM (in my case `192.168.129.52`). This can be viewed at the start menu on the pfSense VM.
145
145
146
-
### LAN Rules
146
+
####LAN Rules
147
147
Go to `Firewall > Rules > LAN > Add` and make a new rule with the following options:
148
148
- Action: `Block`
149
149
- Address Family: `Ipv4+IPv6`
@@ -158,7 +158,7 @@ The final LAN configuration will look something like this:
158
158
159
159
This makes sure that the internal networks behind the WAN cannot reach our home network. If you want to connect from a device on your home network, you can add another allow rule at the top for that specific IP.
160
160
161
-
### Cyber Lab Rules
161
+
####Cyber Lab Rules
162
162
Go to `Firewall > Rules > Cyber Lab > Add rule to end`:
163
163
- Address Family: `IPv4+IPv6`
164
164
- Protocol: `Any`
@@ -190,7 +190,7 @@ The final Cyber LAB configuration will look something like this:
190
190
191
191
These rules ensure that devices in the Cyber Lab can communicate with each other, access the internet, and interact with the Attacker VM.
192
192
193
-
### AD LAB Rules
193
+
####AD LAB Rules
194
194
Go to `Firewall > Rules > AD Lab > Add rule to end`:
195
195
- Action: `Block`
196
196
- Address Family: `IPv4+IPv6`
@@ -221,5 +221,5 @@ This setup ensures that devices within the Active Directory domain can communica
221
221
222
222
Now we need to restart pfSense to persist the firewall rules. From the navigation bar select `Diagnostics > Reboot`. Once pfSense boots up you will be redirected to the login page.
223
223
224
-
# Conclusion
224
+
##Conclusion
225
225
Congratulations! You’ve successfully set up your firewall rules and segmented your network. The next step is to create virtual machines and add them to the appropriate network segments by selecting the correct bridge interface in Proxmox. In the following part of this series, we’ll configure the Active Directory environment and introduce common vulnerabilities for further experimentation.
In this post, we're diving into the setup of Windows virtual machines (VMs) in a Proxmox home lab, with the ultimate goal of building an Active Directory (AD) environment. This includes creating a Domain Controller that will also serve as the DHCP server for our AD Lab, and joining a Windows 10 host to the domain. By the end of this guide, you'll have a functional AD lab that you can use for learning, experimenting, and testing.
12
12
13
-
# What You'll Need
13
+
##What You'll Need
14
14
To get started with setting up your Windows VMs and creating the AD Lab, make sure you have the following:
15
15
-[Windows VirtIO Drivers](https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers): Necessary for better performance and compatibility of Windows VMs in Proxmox.
16
16
-[Windows Server 2022 ISO](https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2022): For setting up the Domain Controller.
@@ -20,10 +20,10 @@ To get started with setting up your Windows VMs and creating the AD Lab, make su
20
20
The ISOs typically have a lifespan of 90 to 180 days, but they can often be extended. To be safe, consider taking a snapshot of your VMs right after installation to revert back if needed.
21
21
!!!
22
22
23
-
# Setting Up the AD Lab
23
+
##Setting Up the AD Lab
24
24
We'll start by uploading the necessary ISOs to our Proxmox server. For this guide, we'll create two VMs: a Windows 10 machine and a Domain Controller. Since the setup for both is quite similar, we'll focus on the Domain Controller.
25
25
26
-
## Step 1: Create the Domain Controller VM
26
+
###Step 1: Create the Domain Controller VM
27
27
Create a new Virtual Machine and select the Windows Server 2022 ISO image you downloaded. Check the box to add an additional drive for the VirtIO drivers and select the corresponding ISO image.
## Step 2: Install Active Directory Domain Services
47
+
###Step 2: Install Active Directory Domain Services
48
48
Open Server Manager and select `Add roles and features`. Accept the default settings until you're prompted with the `Server Roles` section. Select `Active Directory Domain Services` and add the necessary features. Once it has installed successfully, select `Close`. I also installed the DNS and DHCP Server Features together with Active Directory Certificate Services, but this is optional.
The next step is to promote the server to a domain controller. You will need to have the domain name you want to use in the next step. I will choose the domain name of `cicada.local`. To promote the server to a domain controller, click on the notification icon on the top section of the Server Manager program. Then select `Promote this server to a domain controller`. Select `Add a new forest` as this is a newly created AD environment. Enter the domain name in the root domain name field. Once the Windows Server has rebooted, you will see the login screen show the domain entered in the previous step.
53
53
54
-
## Step 3: Create a Domain Admin Account
54
+
###Step 3: Create a Domain Admin Account
55
55
After logging in, open `Active Directory Users and Computers`. As I like to keep things organized, I will create a new group for all the user accounts. Right click on your domain and select `New > Organizational Unit` and name it `Groups`. Move all group related objects from the `Users` to the `Groups` folder. Right click on the `Users` folder and select `New > User`.
@@ -62,7 +62,7 @@ Now we need to add the newly created account to the `Domain Admin` group. This c
62
62
63
63
We can then logout of the Administrator account and login with our newly created domain account. Whenever we create a new user account, they are able to login with their credentials on any domain joined host.
64
64
65
-
## Step 4: Configure the DHCP Server
65
+
###Step 4: Configure the DHCP Server
66
66
Go to `Server Manager > Add roles and Features`, select DHCP Server, and complete the installation. Once done, complete the DHCP configuration through the notifications in Server Manager.
67
67
68
68
We then have to configure a DHCP scope. To do so, go to `Server Manager` once again. Then select `Tools > DHCP`. Expand the available options and then right click on IPv4 to create an IPv4 Scope. Set a name for the scope and give it a description if you wish to do so. Select `Next` and set the range to be somewhere inside the `172.16.200.1/24` network. I choose the starting IP to be `172.16.200.11` to give me some room in case I want to add some static IPs later. You can also exclude some IP addresses if you want to.
@@ -71,10 +71,10 @@ We then have to configure a DHCP scope. To do so, go to `Server Manager` once ag
71
71
72
72
When prompted if you want to configure DHCP options for this scope now, choose `Yes`, then select `Next`. You will then be prompted to select the IP address for the default gateway. The IP address we gave our default gateway was `172.16.200.1`. Enter that and click on Add. Then select Next.
73
73
74
-
## Add Windows 10 VM to Domain
74
+
###Add Windows 10 VM to Domain
75
75
Go through the initial setup wizard and login with the local account you created. The next step is to join the Windows 10 VM to the domain. To do so, open the `Settings` program and go to `Accounts > Access work or school > Connect`. In the pop out window, select the option `Join this device to a local Active Directory domain`. Enter the domain name we used to configure our Active Directory forest (I used cicada.local). You will then be prompted for a login.
76
76
77
77
Windows 10 will restart after entering the credentials. After rebooting, you can now login to the domain by selecting Other User in the lower left corner.
78
78
79
-
# Conclusion
79
+
##Conclusion
80
80
Congratulations! You now have a fully functioning Active Directory home lab. With your Domain Controller and Windows 10 VM set up, you’re ready to explore, experiment, and even simulate attacks to understand how AD environments operate and how they can be secured or compromised. In the next part, we’ll delve into common misconfigurations in Windows and Active Directory and explore how attackers might exploit them. Stay tuned!
We are now going to add some simple misconfigurations to our AD Lab. In the final section we will verify them by targeting our network from an outside Linux VM. To make the Active Directory Lab vulnerable we first need to change some settings.
12
12
13
-
# Group Policy Configuration
13
+
##Group Policy Configuration
14
14
Open the `Start menu` and click on `Windows Administrative Tools`, then choose `Group Policy Management`. Expand `Forest` and `Domains`, to view your own domain.
15
15
16
-
## Disable Windows Defender and Firewall
16
+
###Disable Windows Defender and Firewall
17
17
We can create a first GPO that will disable the Windows Defender Firewall so we can more easily experiment with attacks later on. Of course we could also disable (unlink) the policy later.
18
18
19
19
!!!warning
@@ -36,7 +36,7 @@ Expand the sidebar folders to the following: `Computer Configuration > Policies
36
36
37
37
Close Group Policy Management Editor. From the sidebar of Group Policy Management right-click on `Disable Protections` and choose `Enforced`.
38
38
39
-
## Enable WinRM Server
39
+
###Enable WinRM Server
40
40
Right-click on your domain name. Select `Create a GPO in the domain and link here`. Give the GPO the name `Enable WinRM Server`. Right-click on it and choose `Edit`. Using the sidebar go to the following folder: `Computer Configuration > Policies > Administrative Templates > Windows Components > Windows Remote Management (WinRM) > WinRM Service`. Select `Allow remote server management through WinRM` and then click on `Edit policy settings`. Set the policy to `Enabled` and in the IPv4 filter field enter `*`. Click on `Apply` then `OK`.
I found that when applying the GPO to the domain, I was still not able to WinRM from a remote host. I found that enabling the WinRM service throught the Registry solved the issue. To do this go to `Computer Configuration > Preferences > Registry`. Right-click and select `New > Registry Item`. As the registry path select `HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service` and set the value of the IPv4Filter to `*` or whatever IP range you want to include.
Login as a local administator to one of your Windows VMs and navigate to `Control Panel > Network and Internet > Network and Sharing Center > Change Advanced sharing settings > Guest or Public > Turn on File and Printer sharing`.
85
85
86
86
Next create a new folder, Right-click and go to `Properties > Sharing tab > Share` and give the `Everyone` user read permission.
@@ -95,22 +95,22 @@ In the same window go to `User Rights Assignment > Deny access to this computer
Right-click on the Start menu and select Windows PowerShell (Admin).
100
100
In the terminal enter the following:
101
101
```bash
102
102
gpupdate /force
103
103
```
104
104
Now whenever a new device joins our AD environment the Group Policies that apply to all the devices will automatically be applied to them. With this, we have completed the Domain Controller setup.
105
105
106
-
# Account Misconfigurations
107
-
## ASREP Roasting
106
+
##Account Misconfigurations
107
+
###ASREP Roasting
108
108
In older versions of Kerberos, it was possible to allow authentication without a password. Since Kerberos 5, a password is required, which is called `Pre-Authentication`. If an account has the option `Do not require Kerberos preauthentication` checked, an attacker can send any request for authentication to the KDC to retrieve an encrypted TGT that can be brute-forced offline.
Lets start by checking if we can see any available shares on the network. I made one public share on the Windows VM with IP `172.16.200.11`. In Part 1 of this series we added an attacker VM to the AD network as our initial entry point that is whitelisted from the firewall. From this host, we should be able to list the share we made public.
115
115
116
116
```bash
@@ -141,7 +141,7 @@ Informational D 0 Tue Feb 20 12:06:19 2024
141
141
smb: \> more flag.txt
142
142
Br0wsing_F1L3_Sh4r3S_FTW!
143
143
```
144
-
## Evil-WinRM
144
+
###Evil-WinRM
145
145
To verify that we can also WinRM to our Windows VMs I created a honeypot account called `winnie.wonder` with the password `P@ssw0rd123` and logged into `MS01` with this account. By default, PowerShell Remoting (and WinRM) only allows connections from members of the Administrators or Remote Management Group. To add our user to the Built-In Remote Management Users run:
146
146
```bash
147
147
PS C:/> net localgroup "Remote Management Users" /add winnie.wonder
@@ -166,7 +166,7 @@ Info: Establishing connection to remote endpoint
166
166
cicada\winnie.wonder
167
167
```
168
168
169
-
## ASREPRoasting
169
+
###ASREPRoasting
170
170
Assuming we have gathered a list of valid users, we can try to perform an ASREPRoast attack on the domain users to see if any account has the `Do not require Kerberos preauthentication` option set. With a valid list of users, we can use [Get-NPUsers.py](https://github.com/fortra/impacket/blob/master/examples/GetNPUsers.py) from the Impacket toolkit to hunt for all users with Kerberos pre-authentication not required.
Look like we got a valid hash for the user `winnie.wonder`. We can crack the hashes offline using Hashcat with mode `18200` to find the password.
182
182
183
-
# Conclusion
183
+
##Conclusion
184
184
The possible attack surface in an AD environment is very large so we just introduced a few misconfigurations in our home lab. We also went over on how an outsider can find these flaws to possible gain a foothold on one of our systems. In the next part of this series we will look at how we can monitor and defend against these attacks.
0 commit comments