Skip to content

Commit

Permalink
Windows Installation update
Browse files Browse the repository at this point in the history
  • Loading branch information
swiru95 committed Oct 18, 2019
1 parent 48615d1 commit fe0a454
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@ Metasploitable3 is released under a BSD-style license. See COPYING for more deta
## Quick-start

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.

## Building Metasploitable 3
Expand Down
29 changes: 24 additions & 5 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ $virtualBoxMinVersion = "5.1.10"
$packerMinVersion = "0.10.0"
$vagrantMinVersion = "1.9.0"
$vagrantreloadMinVersion = "0.0.1"
$packer = "packer"
$packer = "packer.exe"
$expectedVBoxLocation = "C:\Program Files\Oracle\VirtualBox"
$expectedVagrantLocation="C:\HashiCorp\Vagrant\bin"
$expectedPackerLocation="C\ProgramFiles\Packer"


function CompareVersions ($actualVersion, $expectedVersion, $exactMatch = $False) {
Expand Down Expand Up @@ -32,7 +35,6 @@ function CompareVersions ($actualVersion, $expectedVersion, $exactMatch = $False
}

Write-Host "";
$expectedVBoxLocation = "C:\Program Files\Oracle\VirtualBox"

If ($(Test-Path "$expectedVBoxLocation\VBoxManage.exe") -eq $True) {

Expand Down Expand Up @@ -61,7 +63,19 @@ If (CompareVersions -actualVersion $vboxVersion -expectedVersion $virtualBoxMinV

}

$packerVersion = cmd.exe /c $packer -v
If ($(Test-Path "$expectedPackerLocation\$packer.exe") -eq $True) {

$packerVersion = cmd.exe /c "$expectedPackerLocation/$packer" -v
$packerVersion = $packerVersion.split(" ")[1]

} else {

Write-Host "packer is not installed (or not in the expected location of $expectedPackerLocation\)"
Write-Host "Please download and install it from https://www.packer.io/downloads.html"
exit

}


If (CompareVersions -actualVersion $packerVersion -expectedVersion $packerMinVersion) {

Expand All @@ -75,13 +89,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 = $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) {

Expand Down

0 comments on commit fe0a454

Please sign in to comment.