Update README.

- Remove steps that are not obsolete due to using pre-built box
- Added steps for development
- Removed requirements checks for vagrant-reload plugin
This commit is contained in:
James Barnett 2017-08-07 11:04:31 -05:00
parent 5511bef1ab
commit d50df8c689
No known key found for this signature in database
GPG Key ID: 647983861A4EC5EA
3 changed files with 29 additions and 53 deletions

View File

@ -4,11 +4,11 @@ Metasploitable3 is a VM that is built from the ground up with a large amount of
Metasploitable3 is released under a BSD-style license. See COPYING for more details.
## Building Metasploitable 3
## Building Metasploitable 3 for PenTesting
System Requirements:
* OS capable of running all of the required applications listed below
* VT-x/AMD-V Supported Processor recommended
* 65 GB Available space on drive
* 35 GB Available space on drive
* 4.5 GB RAM
Requirements:
@ -28,17 +28,9 @@ To build automatically:
To build manually:
1. Clone this repo and navigate to the main directory.
2. Build the base VM image by running `packer build --only=<provider> windows_2008_r2.json` where `<provider>` is your preferred virtualization platform. Currently `virtualbox-iso` and `vmware-iso` are supported. This will take a while the first time you run it since it has to download the OS installation ISO.
3. After the base Vagrant box is created you need to add it to your Vagrant environment. This can be done with the command `vagrant box add windows_2008_r2_<provider>.box --name=metasploitable3`.
4. Use `vagrant plugin install vagrant-reload` to install the reload vagrant provisioner if you haven't already.
5. To start the VM, run the command `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 10 minutes.
6. Once this process completes, you can open up the VM within VirtualBox and login. The default credentials are U: vagrant and P: vagrant.
Videos:
Thanks to [Jeremy](https://twitter.com/webpwnized), you can also follow the steps in these videos to set up Metasploitable3:
https://www.youtube.com/playlist?list=PLZOToVAK85MpnjpcVtNMwmCxMZRFaY6mT
2. Run the command `vagrant box add jbarnett-r7/metasploitable3-win2k8`. This will download the 6.5+ GB box file from Vagrant cloud. This may take a while depending on your Internet connection.
3. To start the VM, run the command `vagrant up`. This will start up the VM network. This takes about 5-10 minutes.
4. Once this process completes, you can open up the VM within VirtualBox and login. The default credentials are U: vagrant and P: vagrant.
## Vulnerabilities
* [See the wiki page](https://github.com/rapid7/metasploitable3/wiki/Vulnerabilities)
@ -46,6 +38,30 @@ https://www.youtube.com/playlist?list=PLZOToVAK85MpnjpcVtNMwmCxMZRFaY6mT
## More Information
The wiki has a lot more detail and serves as the main source of documentation. Please [check it out](https://github.com/rapid7/metasploitable3/wiki/).
## Building Metasploitable 3 for Development
System Requirements:
* OS capable of running all of the required applications listed below
* VT-x/AMD-V Supported Processor recommended
* 35 GB Available space on drive
* 4.5 GB RAM
Requirements:
* [Packer](https://www.packer.io/intro/getting-started/install.html)
* [Vagrant](https://www.vagrantup.com/docs/installation/) NOTE: Currently 1.9.1 is recommended as there are build issues with newer versions.
* [Vagrant Reload Plugin](https://github.com/aidanns/vagrant-reload#installation)
* [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
* Internet connection
To build:
1. Clone this repo and navigate to the main directory.
2. Build the base VM image by running `packer build --only=<provider> packer/templates/windows_2008_r2.json` where `<provider>` is your preferred virtualization platform. Currently `virtualbox-iso` and `vmware-iso` are supported. This will take a while the first time you run it since it has to download the OS installation ISO.
3. After the base Vagrant box is created you need to add it to your Vagrant environment. This can be done with the command `vagrant box add packer/builds/windows_2008_r2_<provider>_<version>.box --name=metasploitable3-win2k8`.
4. Use `vagrant plugin install vagrant-reload` to install the reload vagrant provisioner if you haven't already.
5. To start the VM, run the command `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.
6. Once this process completes, you can open up the VM within VirtualBox and login. The default credentials are U: vagrant and P: vagrant.
## Acknowledgements
The Windows portion of this project was based off of 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.

View File

@ -2,7 +2,6 @@ $ErrorActionPreference = "Stop"
$virtualBoxMinVersion = "5.1.10"
$vagrantMinVersion = "1.9.0"
$vagrantreloadMinVersion = "0.0.1"
function CompareVersions ($actualVersion, $expectedVersion, $exactMatch = $False) {
If ($exactMatch) {
@ -59,30 +58,6 @@ If (CompareVersions -actualVersion $vagrantVersion -expectedVersion $vagrantMinV
exit
}
$vagrantPlugins = cmd.exe /c "vagrant plugin list" | select-string -pattern "vagrant-reload"
If (![string]::IsNullOrEmpty($vagrantPlugins)) {
$vagrantPlugins = $vagrantPlugins.ToString().Trim()
$vagrantreloadVersion = $vagrantPlugins.Replace("(", "")
$vagrantreloadVersion = $vagrantreloadVersion.Replace(")", "")
$vagrantreloadVersion = $vagrantreloadVersion.split(" ")[1]
If (CompareVersions -actualVersion $vagrantreloadVersion -expectedVersion $vagrantreloadMinVersion) {
Write-Host "Compatible version of vagrant-reload plugin found."
}
} else {
Write-Host "Could not find a compatible version of vagrant-reload plugin. Attempting to install..."
cmd.exe /c "vagrant plugin install vagrant-reload"
# Hacky version of Try-Catch for non-terminating errors.
# See http://stackoverflow.com/questions/1142211/try-catch-does-not-seem-to-have-an-effect
if($?) {
Write-Host "The vagrant-reload plugin was successfully installed."
} else {
throw "Error installing vagrant-reload plugin. Please check the output above for any error messages."
}
}
Write-Host "All requirements found. Proceeding..."
$vagrant_box_list = cmd.exe /c "vagrant box list" | select-string -pattern "jbarnett-r7/metasploitable3-win2k8"

View File

@ -2,8 +2,6 @@
min_vbox_ver="5.1.10"
min_vagrant_ver="1.9.0"
min_packer_ver="0.10.0"
min_vagrantreload_ver="0.0.1"
function compare_versions {
actual_version=$1
@ -66,19 +64,6 @@ else
exit 1
fi
if compare_versions $(vagrant plugin list | grep 'vagrant-reload' | cut -d' ' -f2 | tr -d '(' | tr -d ')') $min_vagrantreload_ver false; then
echo 'Compatible version of vagrant-reload plugin was found.'
else
echo "A compatible version of vagrant-reload plugin was not found."
echo "Attempting to install..."
if vagrant plugin install vagrant-reload; then
echo "Successfully installed the vagrant-reload plugin."
else
echo "There was an error installing the vagrant-reload plugin. Please see the above output for more information."
exit 1
fi
fi
echo "All requirements found. Proceeding..."
if vagrant box list | grep -q 'jbarnett-r7/metasploitable3-win2k8'; then