How to Create Metasploitable3 Virtual Image

This blog details on how to create a Metasploitable3 virtual machine as OVF and VMDK files so it can be imported in your test environment. Previous version Metasploitable2 comes as a zip file containing virtual images etc. The file can be downloaded from https://sourceforge.net/projects/metasploitable/ or https://information.rapid7.com/metasploitable-download.html . It is a Ubuntu Linux 8.04 and is dated back to 2012.

With new Metasploitable3 which is an ongoing project is Windows 2008 R2 machine but it is not a pre-built virtual image. We have to build it from scratch. Project can be found from Github https://github.com/rapid7/metasploitable3

This document will detail how to build virtual image step-by-step. The process is in 5 steps

  1. Install Vmware Workstation Pro on your laptop
  2. Create a Virtual 64 bit Centos 7 machine (Do not forget to enable Nested-Virtualization)
  3. Install Centos7
  4. Install Metasploitable3 requirements (vagrant, Virtualbox etc)
  5. Download Metasploitable3 scripts from Github and build the virtual image of Metasploitable3 (windows 2008 virtual image)

In step 2 we use Centos7 as additional packages can be installed freely and easily without need for a subscription.

It is assumed that you have Vmware Workstation Pro Installed on your environment. As Vmware allows you to use trial for 30 days just install it to your windows machine https://www.vmware.com/go/downloadworkstation (Please try Vmware Workstation Pro 12 as version 14 is relatively new and you may live some issues) and after that you need to create a Centos7 virtual machine like:

For this machine must access to internet as it will download files it is also suggested that this machine is accessible from your Windows Desktop so use “NAT” type networking when creating Virtual Centos7

Also another issue must be taken in to account is that Virtual Machine must have Nested-Virtualization Enabled. That is basically will allow us to create a virtualization environment in our virtualization environment. For that enable both following options on Virtual Machine:

This machine will be a Centos 7 machine so download ISO files http://mirrors.vooservers.com/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1708.iso and install Centos7 with Desktop and Development packages. It is important you both install Desktop and Development Packages (if there are other required packages it can be later installed via yum command).

If you require help on installing Centos 7 you can visit https://www.tecmint.com/centos-7-installation/

After installing Centos7 64 bit login to machine and now we can start to install prerequisites to build Metasploitable3. Commands must be issued with root user!

  • First we need to install git package so we can clone Metasploitable3 from Github. Following command will also install other rpm packages for git if required

# yum -y install git

  • Now we need to clone Metasploitable3 project from GitHub.

# mkdir /root/build/
# cd /root/build
# git clone
https://github.com/rapid7/metasploitable3

Cloning into 'metasploitable3'…

remote: Counting objects: 2996, done.

remote: Total 2996 (delta 0), reused 0 (delta 0), pack-reused 2995

Receiving objects: 100% (2996/2996), 191.31 MiB | 858.00 KiB/s, done.

Resolving deltas: 100% (1421/1421), done.

# cd /root/build/
# wget
https://releases.hashicorp.com/packer/1.1.1/packer_1.1.1_linux_amd64.zip
# unzip packer_1.1.1_linux_amd64.zip
# mv mv packer /usr/local/bin/
# chmod 755 /usr/local/bin/packer

  • Then we need to install Vagrant and its required plugins to build Metasploitable3

# cd /root/build/

# wget https://releases.hashicorp.com/vagrant/1.9.8/vagrant_1.9.8_x86_64.rpm
# rpm –ihv vagrant_1.9.8_x86_64.rpm
# vagrant plugin install vagrant-reload

  • Last step is to install VirtualBox package

# cd /root/build/

# wget http://download.virtualbox.org/virtualbox/5.1.30/VirtualBox-5.1-5.1.30_118389_el7-1.x86_64.rpm
# rpm –ihv VirtualBox-5.1-5.1.30_118389_el7-1.x86_64.rpm

  • As we have installed all the packages and required dependencies now we can start to build machine. Before building virtual image of Metasploitable3. We need to be sure Virtualization is enabled for our Virtual Centos7 (That is Nested-Virtualization). Following command checks if the CPU has Virtualization Flag enabled. If we cant see it. Poweroff virtual machine and enable it on Virtual Machines configuration as show in this document when creating Virtual Machine on CPU details.

# grep vmx /proc/cpuinfo

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch arat tpr_shadow vnmi ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap xsaveopt

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch arat tpr_shadow vnmi ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap xsaveopt

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch arat tpr_shadow vnmi ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap xsaveopt

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch arat tpr_shadow vnmi ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap xsaveopt

  • It is time to build our Metasploitable3 Virtual Image. But before that you must edit a configuration file. If you don’t do this you will get an error at step “Removing floppy” and you need to start build again and every build takes about 2 hours depending on your machine and it must start from scratch not where you left off.

The configuration file is at /root/build/metasploitable3/windows_2008_r2.json. My changes are.

# diff /root/build/metasploitable3/windows_2008_r2.json windows_2008_r2.json.org

15d14

< "post_shutdown_delay": "2m",

53c52

< "headless": true,

> "headless": false,

So basically we have added "post_shutdown_delay": "2m", line as following

"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",

"post_shutdown_delay": "2m",

"guest_os_type": "winServer2008Standard-64",

And changed "headless": false, to "headless": true,

"iso_checksum": "{{user `iso_checksum`}}",

"headless": true,

"boot_wait": "10m",

We can start to build image now. This step can take 2 hours depending on your internet speed (It downloads Windows 2008 R2 Standart ISO) and your cpu.

# cd /root/build/metasploitable3
# chmod 755 build_win2008.sh
# ./build_win2008.sh

Compatible version of VirtualBox found.

Compatible version of packer was found.

Correct version of vagrant was found.

Compatible version of vagrant-reload plugin was found.

All requirements found. Proceeding…

Building the Vagrant box…

virtualbox-iso output will be in this color.

==> virtualbox-iso: Downloading or copying Guest additions

virtualbox-iso: Downloading or copying: file:///usr/share/virtualbox/VBoxGuestAdditions.iso

==> virtualbox-iso: Downloading or copying ISO

virtualbox-iso: Downloading or copying: http://download.microsoft.com/download/7/5/E/75EC4E54-5B02-42D6-8879-D8D3A25FBEF7/7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso

==> virtualbox-iso: Creating floppy disk…

virtualbox-iso: Copying files flatly from floppy_files

virtualbox-iso: Copying file: ./answer_files/2008_r2/Autounattend.xml

virtualbox-iso: Copying file: ./scripts/configs/microsoft-updates.bat

virtualbox-iso: Copying file: ./scripts/configs/win-updates.ps1

virtualbox-iso: Copying file: ./scripts/installs/openssh.ps1

virtualbox-iso: Copying file: ./scripts/installs/install_dotnet45.ps1

virtualbox-iso: Copying file: ./scripts/installs/install_wmf.ps1

virtualbox-iso: Copying file: ./resources/certs/oracle-cert.cer

virtualbox-iso: Copying file: ./resources/certs/gdig2.crt

virtualbox-iso: Copying file: ./resources/certs/comodorsadomainvalidationsecureserverca.crt

virtualbox-iso: Copying file: ./resources/certs/comodorsacertificationauthority.crt

virtualbox-iso: Copying file: ./resources/certs/addtrust_external_ca.cer

virtualbox-iso: Copying file: ./resources/certs/baltimore_ca.cer

virtualbox-iso: Copying file: ./resources/certs/digicert.cer

virtualbox-iso: Copying file: ./resources/certs/equifax.cer

virtualbox-iso: Copying file: ./resources/certs/globalsign.cer

virtualbox-iso: Copying file: ./resources/certs/gte_cybertrust.cer

virtualbox-iso: Copying file: ./resources/certs/microsoft_root_2011.cer

virtualbox-iso: Copying file: ./resources/certs/thawte_primary_root.cer

virtualbox-iso: Copying file: ./resources/certs/utn-userfirst.cer

virtualbox-iso: Done copying files from floppy_files

virtualbox-iso: Collecting paths from floppy_dirs

virtualbox-iso: Resulting paths from floppy_dirs : []

virtualbox-iso: Done copying paths from floppy_dirs

==> virtualbox-iso: Creating virtual machine…

==> virtualbox-iso: Creating hard drive…

==> virtualbox-iso: Attaching floppy disk…

==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 4115)

==> virtualbox-iso: Executing custom VBoxManage commands…

virtualbox-iso: Executing: modifyvm metasploitable3-win2k8 –memory 4096

virtualbox-iso: Executing: modifyvm metasploitable3-win2k8 –cpus 2

==> virtualbox-iso: Starting the virtual machine…

virtualbox-iso: The VM will be run headless, without a GUI. If you want to

virtualbox-iso: view the screen of the VM, connect via VRDP without a password to

virtualbox-iso: rdp://127.0.0.1:5965

==> virtualbox-iso: Waiting 10m0s for boot…

==> virtualbox-iso: Typing the boot command…

==> virtualbox-iso: Waiting for SSH to become available…

==> virtualbox-iso: Connected to SSH!

==> virtualbox-iso: Uploading VirtualBox version info (5.1.26)

==> virtualbox-iso: Uploading VirtualBox guest additions ISO…

==> virtualbox-iso: Uploading scripts => C:/vagrant

==> virtualbox-iso: Uploading resources => C:/vagrant

==> virtualbox-iso: Provisioning with shell script: ./scripts/configs/update_root_certs.bat

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\addtrust_external_ca.cer

virtualbox-iso: Root

virtualbox-iso: Signature matches Public Key

virtualbox-iso: Certificate "CN=AddTrust External CA Root, OU=AddTrust External TTP Network, O=AddTrust AB, C=SE" added to store.

virtualbox-iso: CertUtil: -addstore command completed successfully.

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\baltimore_ca.cer

virtualbox-iso: Root

virtualbox-iso: Signature matches Public Key

virtualbox-iso: Certificate "CN=Baltimore CyberTrust Root, OU=CyberTrust, O=Baltimore, C=IE" added to store.

virtualbox-iso: CertUtil: -addstore command completed successfully.

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\digicert.cer

virtualbox-iso: Root

virtualbox-iso: Signature matches Public Key

virtualbox-iso: Certificate "CN=DigiCert Assured ID Root CA, OU=www.digicert.com, O=DigiCert Inc, C=US" added to store.

virtualbox-iso: CertUtil: -addstore command completed successfully.

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\equifax.cer

virtualbox-iso: Root

virtualbox-iso: Signature matches Public Key

virtualbox-iso: Certificate "OU=Equifax Secure Certificate Authority, O=Equifax, C=US" added to store.

virtualbox-iso: CertUtil: -addstore command completed successfully.

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\globalsign.cer

virtualbox-iso: Root

virtualbox-iso: Signature matches Public Key

virtualbox-iso: Certificate "CN=GlobalSign Root CA, OU=Root CA, O=GlobalSign nv-sa, C=BE" added to store.

virtualbox-iso: CertUtil: -addstore command completed successfully.

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\gte_cybertrust.cer

virtualbox-iso: Root

virtualbox-iso: Signature matches Public Key

virtualbox-iso: Certificate "CN=GTE CyberTrust Global Root, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US" added to store.

virtualbox-iso: CertUtil: -addstore command completed successfully.

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\microsoft_root_2011.cer

virtualbox-iso: Root

virtualbox-iso: Signature matches Public Key

virtualbox-iso: Certificate "CN=Microsoft Root Certificate Authority 2011, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" added to store.

virtualbox-iso: CertUtil: -addstore command completed successfully.

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\thawte_primary_root.cer

virtualbox-iso: Root

virtualbox-iso: Signature matches Public Key

virtualbox-iso: Certificate "CN=thawte Primary Root CA – G3, OU="(c) 2008 thawte, Inc. – For authorized use only", OU=Certification Services Division, O="thawte, Inc.", C=US" added to store.

virtualbox-iso: CertUtil: -addstore command completed successfully.

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\utn-userfirst.cer

virtualbox-iso: Root

virtualbox-iso: Signature matches Public Key

virtualbox-iso: Certificate "CN=UTN-USERFirst-Object, OU=http://www.usertrust.com, O=The USERTRUST Network, L=Salt Lake City, S=UT, C=US" added to store.

virtualbox-iso: CertUtil: -addstore command completed successfully.

==> virtualbox-iso: Provisioning with shell script: ./scripts/installs/vm-guest-tools.bat

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>if not exist "C:\Windows\Temp\7z920-x64.msi" (powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" 0<NUL )

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>msiexec /qb /i C:\Windows\Temp\7z920-x64.msi

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>if "virtualbox-iso" EQU "vmware-iso" goto :vmware

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>if "virtualbox-iso" EQU "virtualbox-iso" goto :virtualbox

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp

virtualbox-iso: 1 file(s) moved.

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"

virtualbox-iso:

virtualbox-iso: 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18

virtualbox-iso:

virtualbox-iso: Processing archive: C:\Windows\Temp\VBoxGuestAdditions.iso

virtualbox-iso:

virtualbox-iso: Extracting 32Bit

virtualbox-iso: Extracting 32Bit\Readme.txt

virtualbox-iso: Extracting 64Bit

virtualbox-iso: Extracting 64Bit\Readme.txt

virtualbox-iso: Extracting AUTORUN.INF

virtualbox-iso: Extracting OS2

virtualbox-iso: Extracting OS2\VBoxControl.exe

virtualbox-iso: Extracting OS2\VBoxGuest.sys

virtualbox-iso: Extracting OS2\VBoxReplaceDll.exe

virtualbox-iso: Extracting OS2\VBoxService.exe

virtualbox-iso: Extracting OS2\gengradd.dll

virtualbox-iso: Extracting OS2\libc06.dll

virtualbox-iso: Extracting OS2\libc061.dll

virtualbox-iso: Extracting OS2\libc062.dll

virtualbox-iso: Extracting OS2\libc063.dll

virtualbox-iso: Extracting OS2\libc064.dll

virtualbox-iso: Extracting OS2\libc065.dll

virtualbox-iso: Extracting OS2\libc066.dll

virtualbox-iso: Extracting OS2\readme.txt

virtualbox-iso: Extracting OS2\vboxmouse.sys

virtualbox-iso: Extracting VBoxLinuxAdditions.run

virtualbox-iso: Extracting VBoxSolarisAdditions.pkg

virtualbox-iso: Extracting VBoxWindowsAdditions-amd64.exe

virtualbox-iso: Extracting VBoxWindowsAdditions-x86.exe

virtualbox-iso: Extracting VBoxWindowsAdditions.exe

virtualbox-iso: Extracting autorun.sh

virtualbox-iso: Extracting cert

virtualbox-iso: Extracting cert\VBoxCertUtil.exe

virtualbox-iso: Extracting cert\vbox-sha1.cer

virtualbox-iso: Extracting cert\vbox-sha256-r3.cer

virtualbox-iso: Extracting cert\vbox-sha256.cer

virtualbox-iso: Extracting runasroot.sh

virtualbox-iso:

virtualbox-iso: Everything is Ok

virtualbox-iso:

virtualbox-iso: Folders: 4

virtualbox-iso: Files: 28

virtualbox-iso: Size: 59081311

virtualbox-iso: Compressed: 59496448

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha1.cer

virtualbox-iso: TrustedPublisher

virtualbox-iso: Certificate "CN=Oracle Corporation, O=Oracle Corporation, L=Redwood Shores, S=California, C=US" added to store.

virtualbox-iso: CertUtil: -addstore command completed successfully.

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>goto :done

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>msiexec /qb /x C:\Windows\Temp\7z920-x64.msi

==> virtualbox-iso: Provisioning with shell script: ./scripts/configs/vagrant-ssh.bat

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>if exist a:\vagrant.pub (copy a:\vagrant.pub C:\Users\vagrant\.ssh\authorized_keys ) else (powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub', 'C:\Users\vagrant\.ssh\authorized_keys')" 0<NUL )

==> virtualbox-iso: Provisioning with shell script: ./scripts/configs/disable-auto-logon.bat

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /d 0 /f

virtualbox-iso: The operation completed successfully.

==> virtualbox-iso: Provisioning with shell script: ./scripts/configs/enable-rdp.bat

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>netsh advfirewall firewall add rule name="Open Port 3389" dir=in action=allow protocol=TCP localport=3389

virtualbox-iso: Ok.

virtualbox-iso:

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

virtualbox-iso: The operation completed successfully.

==> virtualbox-iso: Provisioning with windows-shell…

==> virtualbox-iso: Provisioning with shell script: ./scripts/configs/disable_firewall.bat

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>netsh advfirewall set allprofiles state off

virtualbox-iso: Ok.

virtualbox-iso:

==> virtualbox-iso: Restarting Machine

==> virtualbox-iso: Waiting for machine to restart…

virtualbox-iso: A system shutdown is in progress.(1115)

virtualbox-iso: A system shutdown is in progress.(1115)

virtualbox-iso: A system shutdown is in progress.(1115)

virtualbox-iso: The interface is unknown.(1717)

virtualbox-iso: /bin/sh: Read-only file system

==> virtualbox-iso: Machine successfully restarted, moving on

==> virtualbox-iso: Pausing 1m0s before the next provisioner…

==> virtualbox-iso: Provisioning with windows-shell…

==> virtualbox-iso: Provisioning with shell script: scripts/installs/install_boxstarter.bat

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>chocolatey feature enable -n=allowGlobalConfirmation

virtualbox-iso: Chocolatey v0.10.8

virtualbox-iso: Enabled allowGlobalConfirmation

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>choco install BoxStarter

virtualbox-iso: Chocolatey v0.10.8

virtualbox-iso: Installing the following packages:

virtualbox-iso: BoxStarter

virtualbox-iso: By installing you accept licenses for the packages.

virtualbox-iso: Progress: Downloading BoxStarter.Common 2.10.3… 100%

virtualbox-iso: Progress: Downloading boxstarter 2.10.3… 100%

virtualbox-iso: Progress: Downloading BoxStarter.WinConfig 2.10.3… 100%

virtualbox-iso: Progress: Downloading boxstarter.bootstrapper 2.10.3… 100%

virtualbox-iso: Progress: Downloading boxstarter.chocolatey 2.10.3… 100%

virtualbox-iso: Progress: Downloading Boxstarter.HyperV 2.10.3… 100%

virtualbox-iso:

virtualbox-iso: BoxStarter.Common v2.10.3 [Approved]

virtualbox-iso: boxstarter.common package files install completed. Performing other installation steps.

virtualbox-iso: C:\ProgramData\Boxstarter

virtualbox-iso: C:\ProgramData\Boxstarter\BuildPackages

virtualbox-iso: The Boxstarter.Common Module has been copied to C:\ProgramData\Boxstarter and added to your Module path.

virtualbox-iso: You will need to open a new console for the path to be visible.

virtualbox-iso: Use 'Get-Module Boxstarter.* -ListAvailable' to list all Boxstarter Modules.

virtualbox-iso: To list all available Boxstarter Commands, use:

virtualbox-iso: PS:>Import-Module Boxstarter.Common

virtualbox-iso: PS:>Get-Command -Module Boxstarter.*

virtualbox-iso:

virtualbox-iso: To find more info visit http://Boxstarter.org or use:

virtualbox-iso: PS:>Import-Module Boxstarter.Common

virtualbox-iso: PS:>Get-Help Boxstarter

virtualbox-iso: Environment Vars (like PATH) have changed. Close/reopen your shell to

virtualbox-iso: see the changes (or in powershell/cmd.exe just type `refreshenv`).

virtualbox-iso: The install of boxstarter.common was successful.

virtualbox-iso: Software install location not explicitly set, could be in package or

virtualbox-iso: default install location if installer.

virtualbox-iso:

virtualbox-iso: BoxStarter.WinConfig v2.10.3 [Approved]

virtualbox-iso: boxstarter.winconfig package files install completed. Performing other installation steps.

virtualbox-iso: The Boxstarter.WinConfig Module has been copied to C:\ProgramData\Boxstarter and added to your Module path.

virtualbox-iso: You will need to open a new console for the path to be visible.

virtualbox-iso: Use 'Get-Module Boxstarter.* -ListAvailable' to list all Boxstarter Modules.

virtualbox-iso: To list all available Boxstarter Commands, use:

virtualbox-iso: PS:>Import-Module Boxstarter.WinConfig

virtualbox-iso: PS:>Get-Command -Module Boxstarter.*

virtualbox-iso:

virtualbox-iso: To find more info visit http://Boxstarter.org or use:

virtualbox-iso: PS:>Import-Module Boxstarter.WinConfig

virtualbox-iso: PS:>Get-Help Boxstarter

virtualbox-iso: The install of boxstarter.winconfig was successful.

virtualbox-iso: Software install location not explicitly set, could be in package or

virtualbox-iso: default install location if installer.

virtualbox-iso:

virtualbox-iso: boxstarter.bootstrapper v2.10.3 [Approved]

virtualbox-iso: boxstarter.bootstrapper package files install completed. Performing other installation steps.

virtualbox-iso: The Boxstarter.Bootstrapper Module has been copied to C:\ProgramData\Boxstarter and added to your Module path.

virtualbox-iso: You will need to open a new console for the path to be visible.

virtualbox-iso: Use 'Get-Module Boxstarter.* -ListAvailable' to list all Boxstarter Modules.

virtualbox-iso: To list all available Boxstarter Commands, use:

virtualbox-iso: PS:>Import-Module Boxstarter.Bootstrapper

virtualbox-iso: PS:>Get-Command -Module Boxstarter.*

virtualbox-iso:

virtualbox-iso: To find more info visit http://Boxstarter.org or use:

virtualbox-iso: PS:>Import-Module Boxstarter.Bootstrapper

virtualbox-iso: PS:>Get-Help Boxstarter

virtualbox-iso: The install of boxstarter.bootstrapper was successful.

virtualbox-iso: Software install location not explicitly set, could be in package or

virtualbox-iso: default install location if installer.

virtualbox-iso:

virtualbox-iso: boxstarter.chocolatey v2.10.3 [Approved]

virtualbox-iso: boxstarter.chocolatey package files install completed. Performing other installation steps.

virtualbox-iso: The Boxstarter.Chocolatey Module has been copied to C:\ProgramData\Boxstarter and added to your Module path.

virtualbox-iso: You will need to open a new console for the path to be visible.

virtualbox-iso: Use 'Get-Module Boxstarter.* -ListAvailable' to list all Boxstarter Modules.

virtualbox-iso: To list all available Boxstarter Commands, use:

virtualbox-iso: PS:>Import-Module Boxstarter.Chocolatey

virtualbox-iso: PS:>Get-Command -Module Boxstarter.*

virtualbox-iso:

virtualbox-iso: To find more info visit http://Boxstarter.org or use:

virtualbox-iso: PS:>Import-Module Boxstarter.Chocolatey

virtualbox-iso: PS:>Get-Help Boxstarter

virtualbox-iso: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Boxstarter

virtualbox-iso:

virtualbox-iso:

virtualbox-iso: The install of boxstarter.chocolatey was successful.

virtualbox-iso: Software install location not explicitly set, could be in package or

virtualbox-iso: default install location if installer.

virtualbox-iso:

virtualbox-iso: Boxstarter.HyperV v2.10.3 [Approved]

virtualbox-iso: boxstarter.hyperv package files install completed. Performing other installation steps.

virtualbox-iso: The Boxstarter.HyperV Module has been copied to C:\ProgramData\Boxstarter and added to your Module path.

virtualbox-iso: You will need to open a new console for the path to be visible.

virtualbox-iso: Use 'Get-Module Boxstarter.* -ListAvailable' to list all Boxstarter Modules.

virtualbox-iso: To list all available Boxstarter Commands, use:

virtualbox-iso: PS:>Import-Module Boxstarter.HyperV

virtualbox-iso: PS:>Get-Command -Module Boxstarter.*

virtualbox-iso:

virtualbox-iso: To find more info visit http://Boxstarter.org or use:

virtualbox-iso: PS:>Import-Module Boxstarter.HyperV

virtualbox-iso: PS:>Get-Help Boxstarter

virtualbox-iso: The install of boxstarter.hyperv was successful.

virtualbox-iso: Software install location not explicitly set, could be in package or

virtualbox-iso: default install location if installer.

virtualbox-iso:

virtualbox-iso: boxstarter v2.10.3 [Approved]

virtualbox-iso: boxstarter package files install completed. Performing other installation steps.

virtualbox-iso: To load all Boxstarter Modules immediately, just enter 'BoxstarterShell'.

virtualbox-iso: Interested in Windows Azure VM integration? Run CINST Boxstarter.Azure to install Boxstarter's Azure integration.

virtualbox-iso: The install of boxstarter was successful.

virtualbox-iso: Software install location not explicitly set, could be in package or

virtualbox-iso: default install location if installer.

virtualbox-iso:

virtualbox-iso: Chocolatey installed 6/6 packages.

virtualbox-iso: See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

virtualbox-iso:

virtualbox-iso: Installed:

virtualbox-iso: – boxstarter.bootstrapper v2.10.3

virtualbox-iso: – boxstarter.hyperv v2.10.3

virtualbox-iso: – boxstarter.winconfig v2.10.3

virtualbox-iso: – boxstarter v2.10.3

virtualbox-iso: – boxstarter.chocolatey v2.10.3

virtualbox-iso: – boxstarter.common v2.10.3

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>chocolatey feature disable -n=allowGlobalConfirmation

virtualbox-iso: Chocolatey v0.10.8

virtualbox-iso: Disabled allowGlobalConfirmation

==> virtualbox-iso: Provisioning with shell script: scripts/chocolatey_installs/7zip.bat

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>chocolatey feature enable -n=allowGlobalConfirmation

virtualbox-iso: Chocolatey v0.10.8

virtualbox-iso: Enabled allowGlobalConfirmation

virtualbox-iso:

virtualbox-iso: C:\Users\vagrant>choco install 7zip

virtualbox-iso: Chocolatey v0.10.8

virtualbox-iso: Installing the following packages:

virtualbox-iso: 7zip

virtualbox-iso: By installing you accept licenses for the packages.

<< THERE ARE A LOT OF PACKEGE INSTALLATION LOGS WHICH ARE OMMITED HERE>>

…………………………………………………………………………………………………………………………………..

 

After successful build your image is located in /root/build/metasploitable3/windows_2008_r2_virtualbox.box file. It is basically a tar archive. You can see contents of it with

# tar tvf windows_2008_r2_virtualbox.box

-rw-r–r– 0/0 1913 2017-09-06 17:52 Vagrantfile

-rw-r–r– 0/0 6881 2017-09-06 17:52 box.ovf

-rw-r–r– 0/0 26 2017-09-06 17:52 metadata.json

-rw-r–r– 0/0 6794144768 2017-09-06 17:52 metasploitable3-win2k8-disk001.vmdk

The files box.ovf and metasploitable3-win2k8-disk001.vmdk is actually important files for Vmware Worksation Pro. You can download windows_2008_r2_virtualbox.box and rename it as windows_2008_r2_virtualbox.tar.gz on your windows desktop so you can import a new machine to your Vmware Workstation. The archive is about 6.5 GB. WinRar may give you CRC error but 7Zip is works perfectly to uncompress this archive. Also on Linux systems you can use tar command for that.

After opening archive you can see it like:

After clicking box.ovf file on Windows Desktop

Rename it to Metasploitable3 and start to Import the Virtual Machine. On some cases such as Vmware Workstation Pro 14 you can get an error message that OVF file does not conform to standarts but Retry to import it. Vmware Workstation Pro 12 works without problem.

Virtual machine may require a restart for 2 times and of course this is a Trial licensed Microsoft Windows.

There are 2 users to logon to system (others for you to find ;))


Username/Password: administrator/vagrant
Username/Password: vagrant/vagrant

As this is a Windows 2008 R2 machine give the IP address and start to scan with your Nexpose/InsightVM and/or Metasploit Pro.

After a scan with Nexpose/InsightVM you can get more than 500 vulnerabilities so you can use it as a Test Lab