Skip to content

Commit

Permalink
Land #562, Update general dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartin-tech committed Jan 8, 2022
2 parents abbc88a + 52b4da6 commit 45f2737
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 40 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Requirements:

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`, `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.
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_*_0.1.0.box --name=metasploitable3-win2k8`.
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_*_0.1.0.box --name=rapid7/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 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.
6. Once this process completes, you can open up the VM within VirtualBox and login. The default credentials are:
Expand Down
4 changes: 2 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ErrorActionPreference = "Stop"

$virtualBoxMinVersion = "5.1.10"
$packerMinVersion = "0.10.0"
$virtualBoxMinVersion = "6.1.0"
$packerMinVersion = "1.6.0"
$vagrantMinVersion = "1.9.0"
$vagrantreloadMinVersion = "0.0.1"
$packer = "packer.exe"
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

min_vbox_ver="5.1.10"
min_vbox_ver="6.1.0"
min_vagrant_ver="1.9.0"
min_packer_ver="0.10.0"
min_packer_ver="1.6.0"
min_vagrantreload_ver="0.0.1"
min_vagrantvmware_ver="0.0.1"
min_vagrantparallels_ver="0.0.1"
Expand Down
3 changes: 2 additions & 1 deletion chef/cookbooks/metasploitable/recipes/phpmyadmin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

bash "download and extract phpmyadmin" do
code <<-EOH
wget -c -t 3 -O /tmp/phpMyAdmin-3.5.8-all-languages.tar.gz https://files.phpmyadmin.net/phpMyAdmin/3.5.8/phpMyAdmin-3.5.8-all-languages.tar.gz
wget -c -t 3 --no-check-certificate -O /tmp/phpMyAdmin-3.5.8-all-languages.tar.gz https://files.phpmyadmin.net/phpMyAdmin/3.5.8/phpMyAdmin-3.5.8-all-languages.tar.gz
echo "a129d4f03901c047799f634b122734ab687b48975563c87adbf5dea679676e11 /tmp/phpMyAdmin-3.5.8-all-languages.tar.gz" | shasum -a 256 --check --status
tar xvfz /tmp/phpMyAdmin-3.5.8-all-languages.tar.gz -C /var/www/html
mv /var/www/html/phpMyAdmin-3.5.8-all-languages /var/www/html/phpmyadmin
EOH
Expand Down
1 change: 0 additions & 1 deletion packer/templates/aws/ubuntu_1404_ctf_2017.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
],
"variables": {
"iso_url": "http://old-releases.ubuntu.com/releases/14.04.1/ubuntu-14.04.1-server-amd64.iso",
"iso_checksum_type": "md5",
"iso_checksum": "ca2531b8cd79ea5b778ede3a524779b9",
"box_version": "0.1.18"
}
Expand Down
7 changes: 2 additions & 5 deletions packer/templates/pro/ubuntu_1404_pro.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{
"type": "vmware-iso",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": false,
"http_directory" : "{{template_dir}}/../../http",
Expand All @@ -25,7 +24,7 @@
"communicator": "ssh",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
"ssh_timeout": "2h",
"shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
"guest_os_type": "Ubuntu_64",
"tools_upload_flavor": "linux",
Expand All @@ -41,7 +40,6 @@
{
"type": "virtualbox-iso",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": false,
"http_directory" : "{{template_dir}}/../../http",
Expand All @@ -63,7 +61,7 @@
"communicator": "ssh",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
"ssh_timeout": "2h",
"shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
"guest_os_type": "Ubuntu_64",
"disk_size": 40000,
Expand Down Expand Up @@ -104,7 +102,6 @@
],
"variables": {
"iso_url": "http://old-releases.ubuntu.com/releases/14.04.1/ubuntu-14.04.1-server-amd64.iso",
"iso_checksum_type": "md5",
"iso_checksum": "ca2531b8cd79ea5b778ede3a524779b9",
"box_version": "0.1.0"
}
Expand Down
7 changes: 2 additions & 5 deletions packer/templates/pro/windows_2008_r2_pro.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
{
"type": "vmware-iso",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": false,
"boot_wait": "10m",
"communicator": "ssh",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
"ssh_timeout": "2h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"guest_os_type": "winServer2008Standard-64",
"tools_upload_flavor": "windows",
Expand Down Expand Up @@ -47,14 +46,13 @@
{
"type": "virtualbox-iso",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": false,
"boot_wait": "10m",
"communicator": "ssh",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
"ssh_timeout": "2h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"guest_os_type": "Windows2008_64",
"disk_size": 61440,
Expand Down Expand Up @@ -138,7 +136,6 @@
],
"variables": {
"iso_url": "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",
"iso_checksum_type": "md5",
"iso_checksum": "4263be2cf3c59177c45085c0a7bc6ca5",
"autounattend": "{{template_dir}}/../../answer_files/2008_r2/Autounattend.xml",
"scripts_dir": "{{template_dir}}/../../../scripts",
Expand Down
13 changes: 4 additions & 9 deletions packer/templates/ubuntu_1404.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{
"type": "parallels-iso",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"http_directory" : "{{template_dir}}/../http",
"http_port_min" : 9001,
Expand All @@ -24,7 +23,7 @@
"communicator": "ssh",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
"ssh_timeout": "2h",
"shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
"guest_os_type": "ubuntu",
"disk_size": 40000,
Expand All @@ -36,7 +35,6 @@
{
"type": "vmware-iso",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": false,
"http_directory" : "{{template_dir}}/../http",
Expand All @@ -58,7 +56,7 @@
"communicator": "ssh",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
"ssh_timeout": "2h",
"shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
"guest_os_type": "ubuntu-64",
"tools_upload_flavor": "linux",
Expand All @@ -74,7 +72,6 @@
{
"type": "virtualbox-iso",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": false,
"http_directory" : "{{template_dir}}/../http",
Expand All @@ -96,7 +93,7 @@
"communicator": "ssh",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
"ssh_timeout": "2h",
"shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
"guest_os_type": "Ubuntu_64",
"disk_size": 40000,
Expand All @@ -119,7 +116,6 @@
{
"type": "qemu",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": false,
"http_directory" : "{{template_dir}}/../http",
Expand All @@ -142,7 +138,7 @@
"accelerator": "kvm",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
"ssh_timeout": "2h",
"shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
"disk_size": 40000,
"vm_name": "metasploitable3-ub1404",
Expand Down Expand Up @@ -194,7 +190,6 @@
],
"variables": {
"iso_url": "http://old-releases.ubuntu.com/releases/14.04.0/ubuntu-14.04-server-amd64.iso",
"iso_checksum_type": "sha256",
"iso_checksum": "ababb88a492e08759fddcf4f05e5ccc58ec9d47fa37550d63931d0a5fa4f7388",
"box_version": "0.1.12"
}
Expand Down
13 changes: 4 additions & 9 deletions packer/templates/windows_2008_r2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
{
"type": "parallels-iso",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"boot_wait": "10m",
"communicator": "ssh",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
"ssh_timeout": "2h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"guest_os_type": "win-2008",
"parallels_tools_flavor": "win",
Expand Down Expand Up @@ -42,14 +41,13 @@
{
"type": "vmware-iso",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": false,
"boot_wait": "10m",
"communicator": "ssh",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
"ssh_timeout": "2h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"guest_os_type": "windows7srv-64",
"disk_size": 61440,
Expand Down Expand Up @@ -85,14 +83,13 @@
{
"type": "virtualbox-iso",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": false,
"boot_wait": "10m",
"communicator": "ssh",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
"ssh_timeout": "2h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"guest_os_type": "Windows2008_64",
"disk_size": 61440,
Expand Down Expand Up @@ -136,15 +133,14 @@
{
"type": "qemu",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": false,
"boot_wait": "10m",
"communicator": "ssh",
"accelerator": "kvm",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
"ssh_timeout": "2h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"disk_size": 61440,
"format": "qcow2",
Expand Down Expand Up @@ -347,7 +343,6 @@
],
"variables": {
"iso_url": "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",
"iso_checksum_type": "md5",
"iso_checksum": "4263be2cf3c59177c45085c0a7bc6ca5",
"autounattend": "{{template_dir}}/../answer_files/2008_r2/Autounattend.xml",
"scripts_dir": "{{template_dir}}/../../scripts",
Expand Down
2 changes: 1 addition & 1 deletion scripts/installs/install_manageengine.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://archives.manageengine.com/desktop-central/91084/ManageEngine_DesktopCentral.exe', 'C:\Windows\Temp\ManageEngine_DesktopCentral.exe')" <NUL
powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://metasploitable-binaries.s3.amazonaws.com/metasploitable3/ManageEngine_DesktopCentral.exe', 'C:\Windows\Temp\ManageEngine_DesktopCentral.exe')" <NUL
start /WAIT C:\Windows\Temp\ManageEngine_DesktopCentral.exe /w /s /f1C:\Vagrant\resources\manageengine\setup.iss
net stop "ManageEngine Desktop Central Server"
net stop "MEDC Server Component - Apache"
Expand Down
10 changes: 6 additions & 4 deletions scripts/installs/vm-guest-tools.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if not exist "C:\Windows\Temp\7zInstaller-x64.msi" (
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z1604-x64.msi', 'C:\Windows\Temp\7zInstaller-x64.msi')" <NUL
if not exist "C:\Program Files\7-Zip\7z.exe" (
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1604-x64.msi', 'C:\Windows\Temp\7zInstaller-x64.msi')" <NUL
msiexec /qb /i C:\Windows\Temp\7zInstaller-x64.msi
)
msiexec /qb /i C:\Windows\Temp\7zInstaller-x64.msi

if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
Expand Down Expand Up @@ -43,4 +43,6 @@ if exist "C:\Users\vagrant\prl-tools-win.iso" (
)

:done
msiexec /qb /x C:\Windows\Temp\7zInstaller-x64.msi
if exist "C:\Windows\Temp\7zInstaller-x64.msi" (
msiexec /qb /x C:\Windows\Temp\7zInstaller-x64.msi
)

0 comments on commit 45f2737

Please # to comment.