How to Build an Isolated Virtual Lab for Cybersecurity Testing: Step-by-Step Guide

Lab Setup Document: Building a Virtual Lab Environment

 

Course: Cyber Security Lab / Module 1

Objective: To establish a secure, isolated virtualized environment for penetration testing and vulnerability assessments.

 

Part 1: Virtual Network Architecture & Component Mapping

To evaluate security compliance safely without risking infrastructure degradation or triggering production alerts, an isolated local virtual environment was provisioned using VMware Workstation Pro. The architecture segregates the attacking asset, a known vulnerable target framework, and enterprise target client operating systems onto a unified host-only subnet mask structure.

 

Lab Host Configuration Metrics

The following structural table maps the components verified within the isolated virtual network environment:

VM Host Name Operating System Version / Release Assigned IP Address Default User Account Lab Role Profile
Windows 10 Pro Windows 10   150.1.7.100 lonovo Main Windows Host Machine on which VMWare is installed.
Pentesters Kali Linux 2026.1 150.1.7.101 root / kali Attacker OS
Metasploitable2 Metasploitable Linux 2.0 150.1.7.104 msfadmin Vulnerable Target
Windows 10 Windows 10 22H2 150.1.7.105 Pentesters Modern Client Target
Windows 7 Legacy Windows 7 SP1     Legacy Client Target

 

 

 

 


 

Part 2: Installing Operating Systems

 


 

 

Part-3: Configuring Network Adapters

  1. Windows 10 (Main Windows Machine on which VMWare is installed)

            Host Only IP: 150.1.7.100

 

 

 

  1. Kali Linux (Main Attacking Machine)

            Host Only IP: 150.1.7.101

 

 

  1. Metasploitable Linux

            Host Only IP: 150.1.7.104

 

 

  1. Windows 10 (VM Ware Machine)

            Host Only IP: 150.1.7.105

 

 

 

  1. Windows 7 (VM Ware Machine)

            Host Only IP: 150.1.7.____

 

 

 

 

 

Verification of Assigned IP Address (Host Only) to each Machine using ping

 

Part-1 – Windows 10 Main Host Machine

(Connection Test using ping command with other machines on VM Ware)

 

  1. Windows 10 (Main Windows host machine) Connected with

Kali Linux (Attacking Machine)

 

 

  1. Windows 10 (Main Windows host machine) Connected with Metasploitable Linux

 

 

 

 

 

  1. Windows 10 (Main Windows host machine) Connected with

Windows 10 (VM Ware windows machine)

 

  1. Windows 10 (Main Windows host machine) Connected with

Windows 7 (VM Ware windows machine)

 

 

 

 

 

 

 

 

Verification of Assigned IP Address (Host Only) to each Machine using ping

 

Part-2 – Kali Linux Main Attacking Machine

(Connection Test using ping command with other machines)

 

  1. Kali Linux (Main Attacking Machine)

Connected with Windows 10 (Main Windows host machine)

 

 

  1. Kali Linux (Main Attacking Machine) Connected with Metasploitable Linux

 

 

 

  1. Kali Linux (Main Attacking Machine) Connected with

Windows 10 (VM Ware windows machine)

 

  1. Kali Linux (Main Attacking Machine) Connected with

Windows 7 (VM Ware windows machine)

 

 


 

Verification of Assigned IP Address (Host Only) to each Machine using ping

 

Part-3 – Metasploitable Linux

(Connection Test using ping command with other machines)

 

  1. Metasploitable Linux Connected with Windows 10 (Main Windows host machine)
 

 

  1. Metasploitable Linux connected with Kali Linux (Main Attacking Machine)

 

 

 

  1. Metasploitable Linux Connected with Windows 10 (VM Ware windows machine)

 

  1. Metasploitable Linux Connected with Windows 7 (VM Ware windows machine)

 

 

 

 

 

Verification of Assigned IP Address (Host Only) to each Machine using ping

 

Part-4 – Windows 10 (VM Ware windows machine)

(Connection Test using ping command with other machines)

 

  1. Windows 10 (VM Ware windows machine) Connected with

Windows 10 (Main Windows host machine)

 

 

 

  1. Windows 10 (VM Ware windows machine) connected with

Kali Linux (Main Attacking Machine)

 

 

  1. Windows 10 (VM Ware windows machine) connected with Metasploitable Linux

 

  1. Windows 10 (VM Ware windows machine) Connected with

Windows 7 (VM Ware windows machine)

 

 


 

Verification of Assigned IP Address (Host Only) to each Machine using ping

 

Part-5 – Windows 7 (VM Ware windows machine)

(Connection Test using ping command with other machines)

 

  1. Windows 7 (VM Ware windows machine) Connected with

Windows 10 (Main Windows host machine)

 

  1. Windows 7 (VM Ware windows machine) connected with

Kali Linux (Main Attacking Machine)

 

  1. Windows 7 (VM Ware windows machine) connected with Metasploitable Linux

 

  1. Windows 7 (VM Ware windows machine) Connected with

Windows 10 (VM Ware windows machine)

 

 

 

Part-4: Verification and Validation

  1. Perform a Ping Sweep & Document IPs

 

From Kali Linux (Attacking OS) running ping sweep using fping -g command revealed that on the network following machines are alive against these IP addresses:-

 

  1. Host OS Windows 10            –           IP: 150.1.7.100 is alive
  2. Kali Linux (attacking OS)     –           IP: 150.1.7.101 is alive

            iii.        VM OS Metasploitable2        –           IP: 150.1.7.104 is alive

  1. VM OS Windows 10              –           IP: 150.1.7.105 is alive

 

 

 


 

  1. Scan Metasploitable & Save Output

 

From Kali Linux (Attacking OS) running nmap against Metasploitable2 and saved the results into a text file named metasploitable_scan.txt and saved this file on desktop

 


 

  1. Hostname Resolution for Windows VMs

 

To verify that Kali Linux can resolve the hostnames of Windows VMs on the NetBIOS workgroup:

  1. Using nmblookup (NetBIOS Name Query)

Runing nmblookup -A command on target Windows IP: 150.1.7.105 which is denied/ no reply from 150.1.7.105

 

 

 

 

  1. Using nmap NetBIOS Script

Runing nmap -sU –script nbstat.nse command on target Windows IP: 150.1.7.105

(still no response)

 

 

 

iii.        Add Local Hostname Resolution

Resolved directly by hostname by edit /etc/hosts file:

 

 

  1. Final Verification Steps
  2. Test Hostname Resolution with ping

Run a simple ping command using the hostname instead of the IP address:

ping win10-vm -c 2

 

Requirement Status Evidence
1. Ping Sweep Done Executed via fping / nmap
2. Target Scan (metasploitable_scan.txt) Done Saved port scan output for 150.1.7.104
3. Hostname Resolution Done Mapped in /etc/hosts & verified via

ping win10-vm -c 2

 

 

 

Reflection Report: Lab Setup & Isolated Environments

Challenges Faced and Solutions:

During the setup of the virtual security testing lab, two main challenges were encountered:

  1. Network Isolation & ICMP Blocking: Initially, Windows target machines dropped ping requests from Kali Linux due to default Windows Firewall rules. This was resolved by creating an inbound rule allowing ICMPv4-In traffic via netsh advfirewall.
  2. Multi-NIC IP Configurations: Kali Linux had multiple network adapters active (eth0 and eth1), causing routing confusion. Bringing down unnecessary interfaces ensured all traffic flowed strictly through the Host-Only subnet (150.1.7.0/24).

Importance of an Isolated Lab in Ethical Hacking: Conducting vulnerability assessments and penetration testing in an isolated host-only environment is critical for enterprise security. It prevents accidental exposure of attack tools onto live production networks, eliminates the risk of triggering false alarms in real security devices, and ensures compliance with legal and ethical boundaries.

 

Post Your Comment