aidenpearce369
Published on

Offsec AD (Part 3) : Setting up Kali VM & Resolving Network

Prologue

Welcome back, fellow cybersecurity enthusiasts! In our last blog, we embarked on the exciting journey of setting up domain users and computers for an Active Directory (AD) lab. Today, we'll take things a step further as we delve into the world of penetration testing on our freshly established AD domain.

So, buckle up as we explore the process of resolving network issues and installing Kali Linux to launch an effective pen test on our AD domain.

Installing Kali Linux

Kali Linux, the go-to operating system for ethical hackers, is a powerful tool that equips us with a wide array of penetration testing utilities. You can find the VMware image for Kali Linux from the below link.

https://www.kali.org/get-kali/#kali-virtual-machines

Installing Kali Linux in VMware is a straightforward process. Choose either the 32-bit or 64-bit version based on your host machine's architecture and follow the below steps.

  1. Open VMware Workstation Player.
  2. Go to "File" > "Open..."
  3. Browse to the location where you downloaded or saved the Kali Linux VMX file.
  4. Select the VMX file and click "Open."

After importing the VMX file, VMware Workstation Player will display the virtual machine's settings. Review and verify the hardware configuration to ensure it meets your requirements. You can make changes to the hardware settings if needed. Once you've reviewed the settings, click "Play virtual machine" to power on the Kali Linux virtual machine.

After booting into Kali linux, perform apt update && apt upgrade to install all libraries and dependencies in the Kali Linux VM.

Kali-Update

Kali-Upgrade

Now lets try reaching our Domain Controller of our AD lab using nmap.

Kali-PreCheck-DC

Now we have setup our pentesting VM. But still we have a problem, where the AD domain and the attacker are on different subnets. We will be resolving this network issue for better connectivity for performing the pentesting.

Resolving Network Issues

Before we venture into penetration testing, it's crucial to ensure that our network is robust and error-free. In this section, we'll address common network issues and provide effective troubleshooting methods to resolve them. We take the next step towards optimizing our network by our shifting VMs to a different subnet and resolving DNS connectivity issues.

On the Host's machine, you can find many interfaces for VMware,

VMInterface

For our AD lab, I will be using the interface VMnet1,

Changing the network adapters of every VMs (3 AD VMs + 1 Kali VM) on their Virtual Machine settings to VMnet1.

DC-Settings

Kali-Settings

User1-Settings

User2-Settings

Now changing the DNS and Static IP in the Domain Controller.

DC-ChangeIP

Flushing the DNS cache and registering it again to reflect the changes.

DC-FlushDNS

DC-Reflection

After the IP gets changed successfully, lets start the Performance Counters of the DNS server. Now the DNS should work perfectly within our new subnet.

DNS-DC

After the network adapter change, our attacker VM will also be in the same subnet.

Kali-IP

Now the both machines should be able to interact perfectly.

Kali-to-DC

DC-to-Kali

We haven't made any changes on our Domain Computers yet.

Pinging-DC-Computers

Performing the network changes using the Local Administrator credential of those machines.

User1-N1

User1-N2

User1-N3

User1-N4

User2-N4

Now our Domain Computers should be perfectly connected to the domain.

User1

User2

By default we cannot ping our Domain Computers due to the firewall present in the system. If we need to enable pings we can enable the rule for the Inbound connections on the Domain Computers.

Firewall-Rule

Ping-Computer

Now lets run a nmap scan to check the result after adding it in /etc/hosts.

HostsFile

NmapScan

The attacker VM is now configured to interact with the domain subnet. But it needs internet access to install offensive tools and dependencies. This can be simply sorted out by adding a second network interface to the VM.

SecondInterface1

SecondInterface2

Conclusion

Congratulations! You've successfully transformed your AD lab from a basic domain setup to an advanced penetration testing environment using Kali Linux. By honing your skills in resolving network issues and performing ethical hacking, you're well on your way to becoming a proficient cybersecurity professional.

Stay tuned for more exciting cybersecurity topics in our upcoming blogs! Happy hacking, and as always, stay curious and stay secure.