If you want to start hacking, you will need to have a hacking lab, this will let you practice hacking legally in a more realistic way, today we are gonna show you how to setup your first hacking lab step by step, let’s get started.
Requirements:
A computer with:
- A 64-bit processor that supports virtualization (a quad-core i5 is a good choice for getting started).
- 8GB of ram (16GB is recommended).
- A large hard drive space (250GB or 500GB is recommended, SSD is preferred).
- A safe and updated host OS (Windows, Linux, or macOS).
Now it’s time to setup the hacking lab:
Step 1: Install VirtualBox
There are a lot of hypervisors, but since you are just getting started, we are gonna use a hypervisor called VirtualBox, it’s free and open source provided by Oracle, it’s a great hypervisor if you are a beginner and want to just get started, so let’s install it:
- Go to VirtualBox website and click on “Download VirtualBox”:

- Under “VirtualBox platform packages”, choose your operating system, since most people use Windows we are gonna choose “Windows hosts”:

- After downloading is completed, open the file, you will see this window, click on “Next”.

- After that you will see this, change the path if needed, otherwise click on “Next”:

- After that check whatever you want here, it’s up to you, but we recommend you check everything and click on “Next”:

- After that click on “Yes”:

- After that click on “Install”:

- During the installation, you will see some pop-ups like this, just click on “Install”:

- Last but not least, click on “Finish”:

Install VirtualBox Extension Pack:
- Go back to the Download page, under “VirtualBox 6.1.38 Oracle VM VirtualBox Extension Pack”, click on “All supported platforms”:

- After downloading the file, open it, this will open VirtualBox and show you this window, click on “Install”:

- After that, you will see another window containing license agreement, scroll to down and click “I Agree”:

- Last but not least, click on “OK”:

Step 2: Download Kali Linux
Now we are gonna install our attacker machine, in this case, we are gonna use Kali Linux because it’s beginner-friendly and it has all necessary hacking tools preinstalled, so let’s get started:
- Go to Kali Linux website and click “Download”:

- After that you will see this page, click on “Virtual Machines”:

- After that you will see this page, Under “VirtualBox” you will see a tiny download icon, click on it and the file will download:


Step 3: Import Kali Linux into VirtualBox and set it up
Now that we have downloaded the file, we are gonna import it to VirtualBox:
- After Downloading the file, extract it using your favorite tool (7-Zip or Winrar…).
- Open the extracted folder, you will see 2 files, click the one with 1Kb size:

- After that you will see VirtualBox opened with the virtual machine like this, now it’s time to configure the machine, click on “settings”:

- After that you will see a new window, click on “System” and allocate RAM to the machine you can choose as much as you want, just be careful that you don’t give it more than the system can handle, for an 8GB RAM pc 2GB is fine which is 2048MB, on a 16GB RAM pc 4GB is good:

- After that click on “Processor” and allocate CPU cores to the machine, if you have a dual-core CPU, choose 1 core, if you have a quad-core CPU, choose 2 cores.
- In case you know what you are doing and want to customize it even more, you can do that in settings, it is recommended to read the documentation.
- After that go to the main VirtualBox window and click on “start”:

- After booting, you will see the login screen, the credentials are simple: “kali” for username and “kali” for password (Without quotes).
- Congratulations, you have successfully installed Kali Linux, but there is a step that’s highly recommended which is to update Kali Linux, let’s do that:
- Open the terminal.
- After that, type this command:
sudo apt update && sudo apt full-upgrade -y
Step 4: Download and install Metasploitable 2
Metasploitable 2 will be our target machine, it’s one of the best choices for beginners, and it’s so vulnerable, let’s install it:
- go to this website: https://sourceforge.net/projects/metasploitable/files/Metasploitable2/ you will see this page:

- The file will automatically download, after it downloads, unzip the file with your favorite tool, open the folder, and you will see these files:

- If necessary, move the folder to a path of your own choice where the folder will not be deleted.
- Open VirtualBox, at the top you will see this icon, click it, this will let us create the machine:

- Now you will see this window, quick note: it may look different since I use Linux with dark mode, but it’s the same as Windows, so don’t worry.

- All that you have to do is set a name (Whatever name you want) I will write “Metasploitable2” for this example, then change “Type” to “Linux”, and change the version to “Ubuntu (64-bit)”, changing “Machine Folder” is optional, but just keeping it as it is fine, now this will be the final result:

- Click on “Next”, now you will see this window that tells you how much ram you want to allocate, 512MB is more than enough, if you have less ram, 256MB is fine, for this example, I will allocate 512MB:

- Click on “next”, and you will see this window, here we are gonna choose the hard drive (in our case it is the VMDK file that we downloaded ), you will have three options, choose the last one that says “Use an existing virtual hard drive file”:

- After that, click on the folder icon, you will see this window, click on “Add”:

- Now go to the VMDK file and double click it or click on “open”:

- After that, you will see this window, double click on the file name or click or click on “choose”:

- After that you will automatically go back to this window, and click on “Create”:

- Now you have successfully created the virtual machine, to start the virtual machine, click on “Start”:

- All you have to do now is to wait until you see this:

- They will ask you for the username and password, the username is “msfadmin” and the password is “msfadmin”, you will see that the password is not showing, don’t worry, this is just a security feature on Linux.
- Congratulations, Metasploitable 2 is successfully installed.
Step 6: Checking the IP address
Checking the IP is essential to find if everything is working fine, all that you have to do is to have both Kali Linux and Metasploitable 2 turned on, on both of them, open the terminal and write this command:
ip a
This will show the local IP address of the machine, as an example, I wrote the command on Metasploitable 2, and this showed:

As you can see, the IP address is 10.0.2.15 (ignore the 127.0.0.1 IP address), after getting the IP address, go to the Kali Linux terminal and write this command (change the IP address with yours):
ping -c 4 10.0.2.15
If you are seeing something similar to this, then everything is working fine:
PING 10.0.2.15 (10.0.2.15) 56(84) bytes of data.
64 bytes from 10.0.2.15: icmp_seq=1 ttl=254 time=0.582 ms
64 bytes from 10.0.2.15: icmp_seq=2 ttl=254 time=0.538 ms
64 bytes from 10.0.2.15: icmp_seq=3 ttl=254 time=0.554 ms
64 bytes from 10.0.2.15: icmp_seq=4 ttl=254 time=0.566 ms--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3083ms
rtt min/avg/max/mdev = 0.538/0.560/0.582/0.016 ms
Now you have successfully installed your own hacking lab, now you can practice your hacking skills safely, to recap, we have downloaded and installed VirtualBox, then we installed the attacking machine (Kali Linux), and after that, we installed the target machine (Metasploitable 2), and in the end, we have checked that they are both on the same network, you are now ready to start your hacking journey, we have some good resources to get started including the YouTube channels that will teach you hacking and websites that you can practice on, good luck on your journey.
Thank you for reading this article, if you like our content, don’t forget to give us a clap and follow us, this encourages us to keep posting and staying consistent, thank you again, and I see you in the next article.