The Wayback Machine - https://web.archive.org/web/20241116220145/https://www.geeksforgeeks.org/how-to-install-metasploitable-2-in-virtualbox/
Open In App

How to install Metasploitable 2 in VirtualBox

Last Updated : 04 Dec, 2022
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

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.

 

  • now a window will pop up and you will be asked to provide some details like the name of your machine, installation path, type, and version.
  • fill in the details like:
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.

 

  • Now locate the file that we have extracted.

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

 

  • We are good to go with the machine just press the start button from the top and wait for it to start and load the instance.

 

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

 

  • once you log in with credentials you will be directed to the machine and we are done with the installation process.

Demo of penetration testing with Metasploitable 2

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

  • First, we need to run both instances at the same time side by side so that we will be able to see the changes clearly. launch Vbox and start both Linux and Metasploitable 2 side by side.

 

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

  • now let’s open the terminal and check for the IP address of Metasploitable 2 on which we are going to perform the attack. use the following command:
msfadmin@metasploitable:~$ ifconfig
  • from the above image, we can see that we have an IP address i.e. 192.168.10.5 of the target machine.

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.

  • now the first step is to look for loops and vulnerabilities so that we can exploit the machine, to do so we will use Nmap scan on a Linux terminal. use command:
root-user-#/ $ nmap -sV -O 192.168.10.5

 

  • in the above command -sV is used for getting the versions of services running on the target machine and -O is used to detect the operating system on the target machine.
  • now we can see that we have so many exploitations ways and vulnerabilities to perform, we will be using the vsftpd_234_backdoor exploit, for exploitation and gaining access to the machine.
  • open Metasploit Framework with the command:

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
  • after following the commands, we are going to choose the exploit that is vsftpd_backdoor and then set Rhost (targeted IP).

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:

  • first, let’s select the exploit that we are going to use in this case it is vsftpd_backdoor, so we will use the following command :
msf6~/ use exploit/unix/ftp/vsftpd_234_backdoor
  • after selecting the above exploit let’s set up the target to which we are deploying the exploit.
msf6~/ (unix/ftp/vsftpd_234_backdoor): show options

 

  • now we can see that we have the option to set RHOST which is the receiver host. so we will set it to the IP address of the target machine.
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
  • after setting RHOST just enter the exploit command and you will see the command shell of the target machine is obtained.

 

  • now we have successfully penetrated the target by obtaining a shell, you can try commands and verify in both machines at the same time. 

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
  • so we have successfully taken look into how Metasploitable is useful for practicing penetration testing skills.
  • we can see that both sides of the files are the same and we have root access to the machine.

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.



Similar Reads

How to Link Kali Linux with Metasploitable 2
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
4 min read
How to Install RHEL 8 on VirtualBox ?
Red Hat Enterprise Linux (RHEL) is a Linux-based operating system from Red Hat designed for businesses. RHEL can work on desktops, on servers, in hypervisors, or in the cloud. Red Hat and its community-supported counterpart, Fedora, are among the most widely used Linux distributions in the world. The best way to run two or more Operating Systems si
4 min read
How to Install Deepin on VirtualBox?
Deepin is a Debian-based distribution that aims to provide a user-friendly, user-friendly and reliable operating system. It does not only include the best open source world has to offer, but also it has created its own desktop environment called DDE which is based on the Qt 5 toolkit. It focuses much of its attention on intuitive design. Features:N
3 min read
How to Install Kali Linux VirtualBox Image?
Kali Linux is considered as the best perpetration testing Linux distribution as it comes with every important tool pre-installed in it. If you have a spare system you can directly install Kali into it, but if you plan to use it in a virtual environment then the best and safest method would be to use VirtualBox in your system. You can download Virtu
2 min read
How to Install Kali Linux in VirtualBox?
Dual Booting a Windows Laptop with Kali Linux, Though increases the speed and efficiency of the OS, but we can not switch between Windows and Kali Linux instantly. To do so, we will have to install Kali Linux in Virtual Box or any other hypervisor. So, what is a hypervisor? Refer to this article Hypervisors. So now, whenever we want to switch betwe
5 min read
How to Install Ubuntu Budgie in Virtualbox?
Ubuntu Budgie is a community-developed distribution, integrating the Budgie Desktop Environment with Ubuntu at its core. Whether you use it on an old computer or a powerful workstation, Ubuntu Budgie is adaptable to any device, keeping them fast and usable. It combines the thoroughly-tested and stable Ubuntu core with a modern, lightweight, and tra
4 min read
How to Install Garuda Linux on VirtualBox?
Garuda Linux is a rolling distribution that is based on the Arch Linux operating system, except, like Arch Linux, Garuda Linux comes with a graphical installer which is useful for easy installation, and also has other advanced graphical tools for managing one's system. It is a performance-oriented Linux distro with many performance-enhancing tweaks
3 min read
How to Install Kubuntu on VirtualBox?
Kubuntu is the flavor of the Ubuntu operating system which uses the KDE Plasma Desktop instead of the GNOME desktop environment. Kubuntu 21.04 features the beautiful KDE Plasma. It comes with updates to many core packages, including KDE Frameworks 5.68, Plasma 5.18 LTS KDE Applications 19.12.3, and a new 5.4-based kernel. Features:Provides complete
3 min read
How to install CSI Linux in VirtualBox?
What if there is a multi-purpose operating system designed especially for cyber investigators, yes you read it right and the answer to that question is, yes there is one such operating system known as CSI Linux. It is an open-source 'theme park' for the cyber security industry enthusiast. It has tons of resources for investigations, analysis, and r
3 min read
How to install Kioptrix Level 1 on VirtualBox
Kioptrix is a downloadable VM image file on Vulnhub. It is a VM image challenge to get root access by any means possible. The goal of these is to learn the basic tools and techniques in vulnerability assessment and exploitation. There is more than one way to complete the kioptrix challenge by getting root access. There is a total of 5 kioptrix vuln
2 min read
How to install Ubuntu on VirtualBox?
Installing Ubuntu on VirtualBox is a great way to experience the powerful features of this popular Linux distribution without altering your main operating system. Whether you’re a developer, a student, or simply curious about Linux, setting up Ubuntu on VirtualBox allows you to test and explore in a safe environment. This guide will walk you throug
6 min read
How to Install VirtualBox in Linux?
Virtual Machine abstracts the hardware of our personal computers such as CPU, disk drives, memory, NIC (Network Interface Card), etc., into many different execution environments as per our requirements, hence giving us a feeling that each execution environment is a single computer. For example, VirtualBox. We can create a virtual machine for severa
3 min read
How to Enable Copy and Paste in Oracle VirtualBox?
In this article, we will see how to enable copy and paste from a Windows host to a VirtualBox and vice-versa. We've taken the VirtualBox guest additions which gives us various additional tooling, specifically giving us the ability to copy and paste. It also enables bi-directional copy and pastes. Step 1: Start the Virtual Box and go to Settings as
1 min read
Installing Backtrack on VirtualBox
BackTrack Linux is a custom distribution that focuses on security testing for all skill levels. It is the largest collection of wireless hacking, server exploiting, web application assessing, social-engineering tools which can be found in a single Linux distribution. BackTrack Linux is a fine example of how a specialized Linux distribution should b
2 min read
How to Run Multiple Virtual Machines Windows and Linux Inside VirtualBox?
Virtual Machines are the software applications/files which emulate the physical computers. This process of emulating a physical computer and making able to run instances of it on a single physical machine is called Virtualization. A Virtual Machine (VM) allows us to run multiple or different Operating systems on a single physical machine and share
11 min read
Virtualbox - Virtualization is Enabled but not Working
Virtualization is a technique to separate a service from the underlying physical delivery of that service. It is the process of creating a virtual version of something like computer hardware. Sharing the underlying physical hardware with other virtualized resources, this virtualized resource functions independently like a real thing. Enhancing flex
4 min read
How to install Mailspring on Ubuntu
MailSpring application is an Email Client that provides various high-rich features like email templates, mail merge, custom signatures, and advanced search options. MailSpring application supports various email providers and email services like Gmail, Yahoo, and Microsoft Exchange. In this article, we will be installing the MailSpring application o
4 min read
How to install and configure Docker on Arch-based Linux Distributions(Manjaro) ?
In this article, we are going to see how to install and configure Docker on Arch-based Linux Distributions. Docker is an open-source containerization platform used for building, running, and managing applications in an isolated environment. A container is isolated from another and bundles its software, libraries, and configuration files. Containers
2 min read
How to install the NFS server on Ubuntu?
NFS, which stands for Network File System, was created in 1984 by Sun Microsystems. A file system called Network File System (NFS) enables local access to distant files from various places across a network.NFS has a typical client/server architecture for this access, facilitating sharing between Linux workstations of any distribution. We will demon
4 min read
How to Install Deepin on Linux?
Deepin is the top Linux distribution from China, it provides a beautiful, easy-to-use, safe, and reliable operating system for global users. Deepin is based on Debian's stable branch. The feature that sets Deepin aside from the rest of Linux distributions is its desktop environment known as DDE Deepin Desktop Environment, which was described as "th
3 min read
How to Install Linux on Windows PowerShell Subsystem?
There are several ways to Install a Linux subsystem on your Windows PC Powershell Environment. It is good for learners, but it is recommended using original Linux OS if you are a developer as the Subsystem lacks the pre-installed Linux tools. Before we begin installing a Linux subsystem, we need to first enable a Windows feature for Subsystems. Ena
2 min read
How to Install SimpleJson Package for Python in MacOS?
SimpleJson is an open-source Python package. It is a fast, simple, and extensible Python JSON encoder and decoder. The encoder can be customized to provide serialization in any case without special support for serializing objects. For this purpose, the dump should be used as the default parameter. The decoder can handle any encoded JSON string (def
2 min read
How to install Django with NGINX, Gunicorn, and PostgreSQL on Ubuntu?
This article describes how to install and configure Django with PostgreSQL, Gunicorn, and Nginx on your Ubuntu machine. First, let's look at an overview of all the tools we use. Django is a robust, free, open-source, Python-based web framework that follows the MVT (Model-Template-View) architectural pattern. Though it includes an integrated develop
6 min read
How to Install Santoku on a Virtual Machine ?
Santoku is a bootable Linux distribution that is focused on mobile forensics, analysis, and security. It comes with pre-installed platform drivers SDKs, and utilities and also allows auto-detection and setup of new connected mobile devices. It is a free and open community project sponsored by NowSecure. Requirements:20GB free disk space on other OS
3 min read
How to Install Lazy Script in Kali Linux?
Kali Linux is one of the most advanced hacking OS systems from Linux family. Kali Linux is filled with many hacking tools and supporting learners and hackers worldwide. There are many versions of Kali Linux which provides a good user interface and desired environment. The Lazy Script is designed to help many users to save time and work. The script
2 min read
How to install Virtual Box in Kali Linux
We all have seen that we find lots of installation walkthroughs about how to install a virtual box in windows and run kali Linux on that. But in this installation guide, we are going to show you how you can install Virtual box in the Kali Linux Operating system. Let's start. How to install Virtual Box in Kali Linux Step 1: Launch your kali Linux en
2 min read
How to Install and Configure Fish Shell in Ubuntu?
Fish Shell is a unique user-friendly command-line shell for the different operating systems. fish includes some smart features like syntax highlighting, fancy tab completions and autosuggest-as-we-type that just works by default with no configuration required. fish is mostly written in shell script and in C++. Step 1: Install fish repository in ubu
1 min read
How to install Python3 and PIP on Godaddy Server?
GoDaddy VPS is a shared server that provides computational services, databases, storage space, automated weekly backups, 99% uptime, and much more. It’s a cheaper alternative to some other popular cloud-based services such as AWS, GPC, and Azure. Python is an open-source, cross-platform, high-level, general-purpose programming language created by G
2 min read
How to Install Ulauncher in Ubuntu?
Ulauncher is a fast app launcher which allows searching app and files by pressing hotkeys. Ulauncher is written in Python with GTK+. Below are some Ulauncher app launcher features: Fuzzy search (type in app name without worrying about spelling)built-in themescustomizable shortcutsSearch Google, Wikipedia, and Stack Overflowwide range of plugins 1.
1 min read
How to Install Z Shell(zsh) on Linux?
The ZSH or Z Shell is a Unix based shell or can be called as a command-line interpreter. It is an extended version of the good old Bourne shell (sh). It does have some features form Bash with lots of added features like automatic cd (Change Directory), spell check, path expansion, and many more. It also supports plugins and themes. Installing ZSH o
2 min read
three90RightbarBannerImg