Open In App

How to Link Kali Linux with Metasploitable 2

Last Updated : 04 Dec, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Metasploitable 2 is an intentionally vulnerable pentesting environment, that is used for security research also. For a test environment, the user needs to have a Metasploit instance that can access a vulnerable target, and here the target is functioning at our local network which is Metasploitable 2. When we first install Metasploitable 2 instance in a virtual box it is not configured for working with Kali Linux, so at first, you need to configure both machines to work on the same network so that you can practice pen testing. when you launch the Metasploitable instance you will notice that it has an IP address like 10.10.3.2 or something like that if you try to ping it will not respond because the network is not configured to work in a local environment.

The screenshot below shows the IP Addresses of the Kali Linux machine and Metasploitable 2.

How to Link Kali Linux with Metasploitable 2

 

In the below image, IP address information about Host Operating System (Windows) is shown.

How to Link Kali Linux with Metasploitable 2

 

In the above images, you can see that my local IP address is something like 192.168.1.1 but in Linux and Metasploitable instances they are configured differently.

Configure Metasploitable 2 and Kali Linux Networks to Work Together

To solve this we just need to make a new NAT in the virtual box that will be configured to work with our main system IP range.

Follow the steps mentioned below to configure them with your local machine:

Step 1: In this step, we will be changing the network adapter on which our Virtual Box is configured and we will configure it to make a new NAT network that will be in our local machine IP ranges. 

Go to the virtual box and go for file-> preferences.

Changing Network Adapter

 

Step 2: Now go to the Network Option. under the network section we will be implementing changes to the new NAT network interface.

Select Network

 

Step 3: Within the Network Option-click on the icon at the left to create a new profile for the network. 

After clicking this icon you will be prompted with a small window that is mentioned in the next image below. This option allows us to create NETWORK profiles for our virtual machines/ instances running in Virtual Box.

Create Network

 

Step 4: In this step, we will configure the New NAT network and link it to our local IP range.

A window will pop up, specify the name of the network and provide the IP range for network configuration, recommended to use the range of your local IP address. and click OK. In the Network CIDR, you need to specify a starting IP range with the subnet, by default it must be something like 10.0.0.1. You can find your system IP by entering ipconfig command in the command prompt, and then you can provide a valid range to the network. For example, if your IP address is 192.168.10.6, then you can enter the range from 192.168.10.0 or maybe 192.168.10.1 also.

Entering Network Details

 

Now we need to set these NATs to our both machine instances i.e. Kali Linux and Metasploitable.

Step 5: In this step, we will configure our running instances of virtual machines, kali Linux and Metasploitable.

Go to the settings for Linux machines under settings go for the network. and select the NAT Network in this select the network we just made in my case it’s named NETWORK. As mentioned in the images you just need to select the new NAT network.

Enabling Network Adapter

 

Step 6: Repeat Step 5 for the Metasploitable instance.

Repeating Step 5

 

Conclusion:

We are done now, let’s check for IP addresses now for both machines. Now if you run the ifconfig command in both the machine’s shell/terminal, you will see that both have an IP address that matches your local IP range. It means now we can perform our pentesting without any issues both the machines are running fine and if you want to check if these machines are working fine or if HOST is perfectly up then you can use the PING command.

Checking IP Address

 

You can see how we have both machines under the same local network and now you can begin to test and try your pen testing skills.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads