
Metasploitable3 is a VM that is built from the ground up with a large amount of security vulnerabilities.
Metasploitable3 is a VM that is built from the ground up with a large amount of security vulnerabilities. It is intended to be used as a target for testing exploits with metasploit.
Metasploitable3 is released under a BSD-style license. See COPYING for more details.
To use the prebuilt images provided at https://app.vagrantup.com/rapid7/ create a new local metasploitable workspace:
Linux users:
mkdir metasploitable3-workspace
cd metasploitable3-workspace
curl -O https://raw.githubusercontent.com/rapid7/metasploitable3/master/Vagrantfile && vagrant up
Windows users:
mkdir metasploitable3-workspace
cd metasploitable3-workspace
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/rapid7/metasploitable3/master/Vagrantfile" -OutFile "Vagrantfile"
vagrant up
Or clone this repository and build your own box.
System Requirements:
Requirements:
./build.sh windows2008 to build the Windows box or ./build.sh ubuntu1404 to build the Linux box. If /tmp is small, use TMPDIR=/var/tmp ./build.sh ... to store temporary packer disk images under /var/tmp..\build.ps1 windows2008 to build the Windows box or .\build.ps1 ubuntu1404 to build the Linux box. If no option is passed to the script i.e. .\build.ps1, then both the boxes are built.vagrant up to start both. To start any one VM, you can use:
vagrant up ub1404 : to start the Linux boxvagrant up win2k8 : to start the Windows boxvagrant and P: vagrant.packer build --only=<provider> ./packer/templates/windows_2008_r2.json where <provider> is your preferred virtualization platform. Currently virtualbox-iso, qemu, and vmware-iso providers are supported. This will take a while the first time you run it since it has to download the OS installation ISO.vagrant box add packer/builds/windows_2008_r2_*_0.1.0.box --name=rapid7/metasploitable3-win2k8.vagrant plugin install vagrant-reload to install the reload vagrant provisioner if you haven't already.vagrant up win2k8. This will start up the VM and run all of the installation and configuration scripts necessary to set everything up. This takes about 10 minutes.vagrantvagrantUsing Vagrant and a lightweight Ubuntu 14.04 vagrant cloud box image, you can quickly set up and customize ub1404 Metasploitable3 for development or customization. To do so, install Vagrant and a hypervisor such as VirtualBox, VMWare, or libvirt.
Install the relevant provider plugin:
# virtualbox
vagrant plugin install vagrant-vbguest
# libvirt
vagrant plugin install vagrant-libvirt
Then, navigate to the chef/dev/ub1404 directory in this repository. Examine the Vagrantfile there. Select a base box that supports your provider.
Metasploitable ub1404 uses the vagrant chef-solo provisioner. Configure the
chef_solo block in the Vagrantfile with the metasploitable chef recipes that you
desire -- you can browse them in the chef/cookbooks/metasploitable
folder. Or, add or edit your own cookbook and/or recipes there.
From the chef/dev/ub1404 directory, you can run vagrant up
to get a development virtual ub1404 instance. After the initial up build and provision,
when you edit the chef runlist or when you edit a chef recipe, run
vagrant rsync && vagrant provision from the same directory. For faster
development, you can comment-out recipes that you do not need to rerun -- but
even if they are all enabled, vagrant re-provisioning should not take longer than
one or two minutes. Chef aims to be idempotent, so you can rerun this command often.
Consider taking a snapshot (e.g., vagrant snapshot save fresh) before modifying
recipes, so that you can always return to an initial state (vagrant restore fresh).
If you want a totally fresh snapshot, you can do the initialization with
vagrant up --no-provision, then take a snapshot, followed by vagrant provision.
The wiki has a lot more detail and serves as the main source of documentation. Please check it out.
The Windows portion of this project was based off of GitHub user joefitzgerald's 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.