In this step, you will learn how to set up the Kali Linux and Metasploitable2 virtual machines provided in the lab environment.
- First of all, we need to get the ID of the Kali Linux image, and it could be shown by running the following command:
docker images
Start the Kali Linux container by running the following command, and you should replace image-id
with the actual ID of the Kali Linux image:
docker run -ti --network host image-id bash
- Verify that the Metasploitable2 target is listed in the
/etc/hosts
file by running:
cat /etc/hosts
If the line 192.168.122.102 target
is not present, add it using the following command:
echo "192.168.122.102 target" >> /etc/hosts
- Open a new terminal to start the Metasploitable2 virtual machine on the host machine by running:
sudo virsh start Metasploitable2
Wait for the target machine to start, it may take 1-3 minutes.
- Test the network connectivity between Kali Linux and Metasploitable2 by pinging the target (in Kali Linux virtual machine):
ping 192.168.122.102
or:
ping target
You should see the ping responses, indicating a successful network connection, it would take some time, and you can press Ctrl+C to quit.