mirror of
https://github.com/rapid7/metasploitable3.git
synced 2024-09-21 00:01:14 +02:00
Land #417, Prescription for Windows
This commit is contained in:
commit
4e6327b4f3
10
README.md
10
README.md
|
@ -7,11 +7,21 @@ Metasploitable3 is released under a BSD-style license. See COPYING for more deta
|
||||||
## Quick-start
|
## Quick-start
|
||||||
|
|
||||||
To use the prebuilt images provided at https://app.vagrantup.com/rapid7/ create a new local metasploitable workspace:
|
To use the prebuilt images provided at https://app.vagrantup.com/rapid7/ create a new local metasploitable workspace:
|
||||||
|
|
||||||
|
Linux users:
|
||||||
```
|
```
|
||||||
mkdir metasploitable3-workspace
|
mkdir metasploitable3-workspace
|
||||||
cd metasploitable3-workspace
|
cd metasploitable3-workspace
|
||||||
curl -O https://raw.githubusercontent.com/rapid7/metasploitable3/master/Vagrantfile && vagrant up
|
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.
|
Or clone this repository and build your own box.
|
||||||
|
|
||||||
## Building Metasploitable 3
|
## Building Metasploitable 3
|
||||||
|
|
17
build.ps1
17
build.ps1
|
@ -4,7 +4,10 @@ $virtualBoxMinVersion = "5.1.10"
|
||||||
$packerMinVersion = "0.10.0"
|
$packerMinVersion = "0.10.0"
|
||||||
$vagrantMinVersion = "1.9.0"
|
$vagrantMinVersion = "1.9.0"
|
||||||
$vagrantreloadMinVersion = "0.0.1"
|
$vagrantreloadMinVersion = "0.0.1"
|
||||||
$packer = "packer"
|
$packer = "packer.exe"
|
||||||
|
$expectedVBoxLocation = "C:\Program Files\Oracle\VirtualBox"
|
||||||
|
$expectedVagrantLocation="C:\HashiCorp\Vagrant\bin"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function CompareVersions ($actualVersion, $expectedVersion, $exactMatch = $False) {
|
function CompareVersions ($actualVersion, $expectedVersion, $exactMatch = $False) {
|
||||||
|
@ -32,7 +35,6 @@ function CompareVersions ($actualVersion, $expectedVersion, $exactMatch = $False
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "";
|
Write-Host "";
|
||||||
$expectedVBoxLocation = "C:\Program Files\Oracle\VirtualBox"
|
|
||||||
|
|
||||||
If ($(Test-Path "$expectedVBoxLocation\VBoxManage.exe") -eq $True) {
|
If ($(Test-Path "$expectedVBoxLocation\VBoxManage.exe") -eq $True) {
|
||||||
|
|
||||||
|
@ -75,13 +77,18 @@ If (CompareVersions -actualVersion $packerVersion -expectedVersion $packerMinVer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
If ($(Test-Path "C:\HashiCorp\Vagrant\bin\vagrant.exe") -eq $True) {
|
If ($(Test-Path "$expectedVagrantLocation\vagrant.exe") -eq $True) {
|
||||||
|
|
||||||
$vagrantVersion = cmd.exe /c "vagrant" -v
|
$vagrantVersion = cmd.exe /c "vagrant" -v
|
||||||
$vagrantVersion = $vagrantVersion.split(" ")[1]
|
$vagrantVersion = $vagrantVersion.split(" ")[1]
|
||||||
|
|
||||||
}
|
} else {
|
||||||
|
|
||||||
|
Write-Host "Vagrant is not installed (or not in the expected location of $expectedVagrantLocation\)"
|
||||||
|
Write-Host "Please download and install it from https://www.vagrantup.com/downloads.html/"
|
||||||
|
exit
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
If (CompareVersions -actualVersion $vagrantVersion -expectedVersion $vagrantMinVersion) {
|
If (CompareVersions -actualVersion $vagrantVersion -expectedVersion $vagrantMinVersion) {
|
||||||
|
|
||||||
|
@ -151,7 +158,7 @@ function InstallBox($os_full, $os_short)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Attempting to add metasploitable3-$os_short box to Vagrant..."
|
Write-Host "Attempting to add metasploitable3-$os_short box to Vagrant..."
|
||||||
$vagrant_box_list = cmd.exe /c "vagrant box list"
|
$vagrant_box_list = cmd.exe /c "vagrant box list"
|
||||||
|
|
||||||
If ($vagrant_box_list -match "rapid7/metasploitable3-$os_short") {
|
If ($vagrant_box_list -match "rapid7/metasploitable3-$os_short") {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user