Skip to content

Metasploitable3 Installing and Building (Step by Step)

hello folks,

In this post, I am going to explain how to download and install Metasploitable3 in Linux with Virtual box.

Index

  1. Introduction of Metasploitable3
  2. Setup RequiredTools.
  3. Build Metasploitable3 Automatically ( for Pen tester )
  4. Build Metasploitable3 Manually ( For Developers )
  5. Pro Tip. (Optional)
  6. Download Metasploit3 ( VirtualBox OVA ) (Noo Need to Build)
  7. Acknowledgements

 


Introduction Metasploitable3

Metasploitable3 is a VM that is built from the ground up with a large number of security vulnerabilities. It is intended to be used as a target for testing exploits with Metasploit.

Differences between Metasploitable 3 and the older versions

Previous versions of Metasploitable were distributed as a VM snapshot where everything was set up and saved in that state. Metasploitable 3 introduces a new approach: dynamically building the VM image. It utilizes PackerVagrant, and a ton of scripts to go from nothing to a fully functional, exploitable VM within minutes.


Setup Required Tools

Git Installation.

sudo apt-get install git

Packer Installation 

sudo apt-get install packer

Vagrant Installation 

Download Link: https://releases.hashicorp.com/vagrant/1.9.1/

cd /tmp/
wget https://releases.hashicorp.com/vagrant/1.9.1/vagrant_1.9.1_x86_64.deb
sudo dpkg -i vagrant_1.9.1_x86_64.deb

NOTE: Currently 1.9.1 is recommended as there are build issues with newer versions.

Vagrant Plugin

vagrant plugin install vagrant-reload

For Virtual Box installation follow the OFFICIAL site.

If you don’t have Brain, stop reading here.  😛

If you reading this Online Means you have internet already.

Minimum 8BG Physical Memory required on the Host system for Build Metasploitable. if don’t have 8GB go to Pro Tip Section it will help you.

Go Ahead. 😉


Download Metasploitable3

Actually, Our Metasploitable3 Installation journey starts from here. We have to download Metasploitable 3 from Official Sources and Build it step by step.

Official Project Source Link: https://github.com/rapid7/metasploitable3

Download Project

Using Git

git clone https://github.com/rapid7/metasploitable3.git

Any Browser 

Visit this: https://github.com/rapid7/metasploitable3/archive/master.zip


Build Metasploitable3 Automatically  ( for Pentester )

Run the command

vagrant box add jbarnett-r7/metasploitable3-win2k8

or

vagrant box add metasploitable3-win2k8 https://vagrantcloud.com/jbarnett-r7/boxes/metasploitable3-win2k8/versions/0.1.0/providers/virtualbox.box

download metasploitable3

This will download the 6.5+ GB box file from Vagrant cloud. This may take a while depending on your Internet connection.

List vagrant Box

vagrant box list

vagrant metasploitable3 list

To start the VM

vagrant up

This will start up the VM network. This takes about 5-10 minutes.

Once this process completes, you can open up the VM within VirtualBox and login.

The default credentials are

  • Username: vagrant
  • Password: vagrant.

 


Build Metasploitable3 Manually ( for Developer )

Here, I assume you already downloaded a Metasploitable 3 Project using Git or Browser. If you downloaded using any Browser or Download manager, Please extract it in any Directory where you have to written permission.

Let’s Build Begin,

Fire up terminal and Change Directory to metasploitable3’s folder.

metasploitable3 directory

Now, Download Windows Template.

Syntax : packer build –only=<provider>-iso windows_2008_r2.json

Here <provider> means, Which virtualization platform you are going to use for Importing.

I’m Going to use Virtual Box.

Provider

  • Virtual Box: virtualbox 
  • Vmware: vmware

Warning: This Below command automatically Download Windows Template and Installed it in your Virtual Box and do all required steps like setting up ssh, and other vulnerability. 

packer build --only=virtualbox-iso windows_2008_r2.json

Above Command help u to Download all Pieces Which u required for Next Step. It will take some mins or hours (Depending Your Internet Speed and System 😛 ).

Let’s Add this is a Vagrant environment.

vagrant box add windows_2008_r2_<provider>.box --name=metasploitable3

building metasploitable3

install the reload vagrant provisioner if you haven’t already

vagrant plugin install vagrant-reload

To start the VM

vagrant up

This will start up the VM and run all of the installation and configuration scripts necessary to set everything up. This takes about 20 minutes.

Once this process completes, you can open up the VM within VirtualBox and log in.

The default credentials are

  • Username: vagrant
  • Password: vagrant.

Pro Tips

If you are building for Virtual Box Provider. Modify windows_2008_r2.json files according to your host system.

LineNumber  Code

85 "--memory",
86 "1200"

This is for Ram

91 "--cpus",
92 "2"

This is for CPU.

And For VM-Ware users

 41 "memsize": "2048",
 42 "numvcpus": "2",

Modify this lines.


Download Metasplotitable 3 ( OVA file)

If you tried up by manually downloading and building and got frustrated or if you don’t have tools.

Just Download metasploitable3 OVA File and import in Virtual Box. (Like a Boss)

Download Link: click here


Acknowledgements

The Windows portion of this project was based on GitHub user [joefitzgerald’s](https://github.com/joefitzgerald) [packer-windows](https://github.com/joefitzgerald/packer-windows) project.
The Packer templates, original Vagrantfile, and installation answer files were used as the base template and built upon for the needs of this project.

Greetz : jbarnett ( for Cloud vagrant File )


This all for this post.

Special thanks to my HackTheBox’s Friends @B00gie , @Danners and all other HackTheBox Telegram Group Members. 🙂

If you Like this post, Please Comment below and share with others.

Spread the Knowledge
Published inganeral

One Comment

  1. Emmy Emmy

    Hey, thanks for the Metasploitable3, however can you provide a torrent or magnet link.

Leave a Reply

Your email address will not be published. Required fields are marked *