Update pro version to support Linux VM
This commit is contained in:
parent
520c0564be
commit
428ec322c9
|
@ -0,0 +1,111 @@
|
|||
{
|
||||
"builders": [
|
||||
{
|
||||
"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",
|
||||
"http_port_min" : 9001,
|
||||
"http_port_max" : 9001,
|
||||
"boot_command": [
|
||||
"<esc><wait>",
|
||||
"<esc><wait>",
|
||||
"<enter><wait>",
|
||||
"/install/vmlinuz",
|
||||
" auto=true",
|
||||
" priority=critical",
|
||||
" initrd=/install/initrd.gz",
|
||||
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
|
||||
" -- ",
|
||||
"<enter>"
|
||||
],
|
||||
"boot_wait": "20s",
|
||||
"communicator": "ssh",
|
||||
"ssh_username": "vagrant",
|
||||
"ssh_password": "vagrant",
|
||||
"ssh_wait_timeout": "2h",
|
||||
"shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
|
||||
"guest_os_type": "Ubuntu_64",
|
||||
"tools_upload_flavor": "linux",
|
||||
"disk_size": 40000,
|
||||
"vm_name": "metasploitable3-ub1404",
|
||||
"vmx_data": {
|
||||
"cpuid.coresPerSocket": "2",
|
||||
"memsize": "4096",
|
||||
"numvcpus": "2",
|
||||
"scsi0.virtualDev": "lsisas1068"
|
||||
}
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"http_port_min" : 9001,
|
||||
"http_port_max" : 9001,
|
||||
"boot_command": [
|
||||
"<esc><wait>",
|
||||
"<esc><wait>",
|
||||
"<enter><wait>",
|
||||
"/install/vmlinuz",
|
||||
" auto=true",
|
||||
" priority=critical",
|
||||
" initrd=/install/initrd.gz",
|
||||
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
|
||||
" -- ",
|
||||
"<enter>"
|
||||
],
|
||||
"boot_wait": "20s",
|
||||
"communicator": "ssh",
|
||||
"ssh_username": "vagrant",
|
||||
"ssh_password": "vagrant",
|
||||
"ssh_wait_timeout": "2h",
|
||||
"shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
|
||||
"guest_os_type": "Ubuntu_64",
|
||||
"disk_size": 40000,
|
||||
"vm_name": "metasploitable3-ub1404",
|
||||
"vboxmanage": [
|
||||
[
|
||||
"modifyvm",
|
||||
"{{.Name}}",
|
||||
"--memory",
|
||||
"4096"
|
||||
],
|
||||
[
|
||||
"modifyvm",
|
||||
"{{.Name}}",
|
||||
"--cpus",
|
||||
"2"
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"provisioners": [
|
||||
{
|
||||
"type": "chef-solo",
|
||||
"cookbook_paths": [
|
||||
"{{template_dir}}/../../../chef/cookbooks"
|
||||
],
|
||||
"run_list": [
|
||||
"metasploitable::vm_tools"
|
||||
]
|
||||
}
|
||||
],
|
||||
"post-processors": [
|
||||
{
|
||||
"type": "vagrant",
|
||||
"keep_input_artifact": false,
|
||||
"output": "{{template_dir}}/../../builds/ubuntu_1404_{{.Provider}}_{{user `box_version`}}_pro.box"
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,148 @@
|
|||
{
|
||||
"builders": [
|
||||
{
|
||||
"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",
|
||||
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
|
||||
"guest_os_type": "winServer2008Standard-64",
|
||||
"tools_upload_flavor": "windows",
|
||||
"disk_size": 61440,
|
||||
"floppy_files": [
|
||||
"{{user `autounattend`}}",
|
||||
"{{user `scripts_dir`}}/configs/microsoft-updates.bat",
|
||||
"{{user `scripts_dir`}}/configs/win-updates.ps1",
|
||||
"{{user `scripts_dir`}}/installs/openssh.ps1",
|
||||
"{{user `scripts_dir`}}/installs/install_dotnet45.ps1",
|
||||
"{{user `scripts_dir`}}/installs/install_wmf.ps1",
|
||||
"{{user `resources_dir`}}/certs/oracle-cert.cer",
|
||||
"{{user `resources_dir`}}/certs/gdig2.crt",
|
||||
"{{user `resources_dir`}}/certs/comodorsadomainvalidationsecureserverca.crt",
|
||||
"{{user `resources_dir`}}/certs/comodorsacertificationauthority.crt",
|
||||
"{{user `resources_dir`}}/certs/addtrust_external_ca.cer",
|
||||
"{{user `resources_dir`}}/certs/baltimore_ca.cer",
|
||||
"{{user `resources_dir`}}/certs/digicert.cer",
|
||||
"{{user `resources_dir`}}/certs/equifax.cer",
|
||||
"{{user `resources_dir`}}/certs/globalsign.cer",
|
||||
"{{user `resources_dir`}}/certs/gte_cybertrust.cer",
|
||||
"{{user `resources_dir`}}/certs/microsoft_root_2011.cer",
|
||||
"{{user `resources_dir`}}/certs/thawte_primary_root.cer",
|
||||
"{{user `resources_dir`}}/certs/utn-userfirst.cer"
|
||||
],
|
||||
"vm_name": "metasploitable3-win2k8",
|
||||
"vmx_data": {
|
||||
"cpuid.coresPerSocket": "2",
|
||||
"memsize": "4096",
|
||||
"numvcpus": "2",
|
||||
"scsi0.virtualDev": "lsisas1068"
|
||||
}
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
|
||||
"guest_os_type": "Windows2008_64",
|
||||
"disk_size": 61440,
|
||||
"vm_name": "metasploitable3-win2k8",
|
||||
"floppy_files": [
|
||||
"{{user `autounattend`}}",
|
||||
"{{user `scripts_dir`}}/configs/microsoft-updates.bat",
|
||||
"{{user `scripts_dir`}}/configs/win-updates.ps1",
|
||||
"{{user `scripts_dir`}}/installs/openssh.ps1",
|
||||
"{{user `scripts_dir`}}/installs/install_dotnet45.ps1",
|
||||
"{{user `scripts_dir`}}/installs/install_wmf.ps1",
|
||||
"{{user `resources_dir`}}/certs/oracle-cert.cer",
|
||||
"{{user `resources_dir`}}/certs/gdig2.crt",
|
||||
"{{user `resources_dir`}}/certs/comodorsadomainvalidationsecureserverca.crt",
|
||||
"{{user `resources_dir`}}/certs/comodorsacertificationauthority.crt",
|
||||
"{{user `resources_dir`}}/certs/addtrust_external_ca.cer",
|
||||
"{{user `resources_dir`}}/certs/baltimore_ca.cer",
|
||||
"{{user `resources_dir`}}/certs/digicert.cer",
|
||||
"{{user `resources_dir`}}/certs/equifax.cer",
|
||||
"{{user `resources_dir`}}/certs/globalsign.cer",
|
||||
"{{user `resources_dir`}}/certs/gte_cybertrust.cer",
|
||||
"{{user `resources_dir`}}/certs/microsoft_root_2011.cer",
|
||||
"{{user `resources_dir`}}/certs/thawte_primary_root.cer",
|
||||
"{{user `resources_dir`}}/certs/utn-userfirst.cer"
|
||||
],
|
||||
"vboxmanage": [
|
||||
[
|
||||
"modifyvm",
|
||||
"{{.Name}}",
|
||||
"--memory",
|
||||
"4096"
|
||||
],
|
||||
[
|
||||
"modifyvm",
|
||||
"{{.Name}}",
|
||||
"--cpus",
|
||||
"2"
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"provisioners": [
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{user `scripts_dir`}}",
|
||||
"destination": "C:/vagrant"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{user `resources_dir`}}",
|
||||
"destination": "C:/vagrant"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"remote_path": "/tmp/script.bat",
|
||||
"execute_command": "{{.Vars}} cmd /c C:/Windows/Temp/script.bat",
|
||||
"scripts": [
|
||||
"{{user `scripts_dir`}}/configs/update_root_certs.bat",
|
||||
"{{user `scripts_dir`}}/installs/vm-guest-tools.bat",
|
||||
"{{user `scripts_dir`}}/configs/vagrant-ssh.bat",
|
||||
"{{user `scripts_dir`}}/configs/disable-auto-logon.bat",
|
||||
"{{user `scripts_dir`}}/configs/enable-rdp.bat"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "windows-shell",
|
||||
"remote_path": "C:/Windows/Temp/script.bat",
|
||||
"execute_command": "{{.Vars}} cmd /c C:/Windows/Temp/script.bat",
|
||||
"scripts": [
|
||||
"{{user `scripts_dir`}}/configs/disable_firewall.bat"
|
||||
]
|
||||
}
|
||||
],
|
||||
"post-processors": [
|
||||
{
|
||||
"type": "vagrant",
|
||||
"keep_input_artifact": false,
|
||||
"output": "{{template_dir}}/../builds/windows_2008_r2_{{.Provider}}_{{user `box_version`}}_pro.box",
|
||||
"vagrantfile_template": "{{template_dir}}/vagrantfile-windows_2008_r2.template"
|
||||
}
|
||||
],
|
||||
"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",
|
||||
"resources_dir": "{{template_dir}}/../../..resources",
|
||||
"box_version": "0.1.0"
|
||||
}
|
||||
}
|
|
@ -118,7 +118,7 @@
|
|||
{
|
||||
"type": "vagrant",
|
||||
"keep_input_artifact": false,
|
||||
"output": "{{template_dir}}/../builds/ubuntu_1404_{{.Provider}}.box"
|
||||
"output": "{{template_dir}}/../builds/ubuntu_1404_{{.Provider}}_{{user `box_version`}}.box"
|
||||
}
|
||||
],
|
||||
"variables": {
|
||||
|
|
|
@ -205,7 +205,7 @@
|
|||
{
|
||||
"type": "vagrant",
|
||||
"keep_input_artifact": false,
|
||||
"output": "{{template_dir}}/../builds/windows_2008_r2_{{.Provider}}_{{user `box_version`}}_{{user `box_version`}}.box",
|
||||
"output": "{{template_dir}}/../builds/windows_2008_r2_{{.Provider}}_{{user `box_version`}}.box",
|
||||
"vagrantfile_template": "{{template_dir}}/vagrantfile-windows_2008_r2.template"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -2,131 +2,75 @@
|
|||
# vi: set ft=ruby :
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
# Base configuration for the VM and provisioner
|
||||
config.vm.box = "metasploitable3"
|
||||
config.vm.hostname = "metasploitable3"
|
||||
config.vm.communicator = "winrm"
|
||||
config.vm.define "win2k8" do |win2k8|
|
||||
# Base configuration for the VM and provisioner
|
||||
win2k8.vm.box = "metasploitable3-win2k8-pro"
|
||||
win2k8.vm.hostname = "metasploitable3-win2k8"
|
||||
win2k8.vm.communicator = "winrm"
|
||||
win2k8.winrm.retry_limit = 60
|
||||
win2k8.winrm.retry_delay = 10
|
||||
|
||||
config.vm.network "private_network", type: "dhcp"
|
||||
win2k8.vm.network "private_network", type: "dhcp"
|
||||
|
||||
# Install Chocolatey
|
||||
config.vm.provision :shell, path: "scripts/installs/chocolatey.cmd"
|
||||
config.vm.provision :reload # Hack to reset environment variables
|
||||
# Configure Firewall to open up vulnerable services
|
||||
case ENV['MS3_DIFFICULTY']
|
||||
when 'easy'
|
||||
config.vm.provision :shell, path: "scripts/configs/disable_firewall.bat"
|
||||
else
|
||||
win2k8.vm.provision :shell, path: "scripts/configs/enable_firewall.bat"
|
||||
win2k8.vm.provision :shell, path: "scripts/configs/configure_firewall.bat"
|
||||
end
|
||||
|
||||
# Install BoxStarter
|
||||
config.vm.provision :shell, path: "scripts/installs/install_boxstarter.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Install 7zip
|
||||
config.vm.provision :shell, path: "scripts/chocolatey_installs/7zip.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Adjust password policy
|
||||
config.vm.provision :shell, path: "scripts/configs/apply_password_settings.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Add users and add to groups
|
||||
config.vm.provision :shell, path: "scripts/configs/create_users.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Vulnerability - Unpatched IIS and FTP
|
||||
config.vm.provision :shell, path: "scripts/installs/setup_iis.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
config.vm.provision :shell, path: "scripts/installs/setup_ftp_site.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Vulnerability - Setup for Apache Struts
|
||||
config.vm.provision :shell, path: "scripts/chocolatey_installs/java.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
config.vm.provision :shell, path: "scripts/chocolatey_installs/tomcat.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
config.vm.provision :reload # Hack to reset environment variables
|
||||
config.vm.provision :shell, path: "scripts/installs/setup_apache_struts.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Vulnerability - Setup for Glassfish
|
||||
config.vm.provision :shell, path: "scripts/installs/setup_glassfish.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
config.vm.provision :shell, path: "scripts/installs/start_glassfish_service.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Vulnerability - Jenkins (1.8)
|
||||
config.vm.provision :shell, path: "scripts/installs/setup_jenkins.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Vulnerability - Wordpress and phpMyAdmin
|
||||
# This must run after the WAMP setup.
|
||||
config.vm.provision :shell, path: "scripts/chocolatey_installs/vcredist2008.bat" # Visual Studio 2008 redistributable is a requirement for WAMP
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
config.vm.provision :shell, path: "scripts/installs/install_wamp.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
config.vm.provision :shell, path: "scripts/installs/start_wamp.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
config.vm.provision :shell, path: "scripts/installs/install_wordpress.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Vulnerability - JMX
|
||||
config.vm.provision :shell, path: "scripts/installs/install_openjdk6.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
config.vm.provision :shell, path: "scripts/installs/setup_jmx.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Vulnerability - Rails Server
|
||||
config.vm.provision :shell, path: "scripts/installs/install_ruby.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
config.vm.provision :shell, path: "scripts/installs/install_devkit.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
config.vm.provision :shell, path: "scripts/installs/install_rails_server.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
config.vm.provision :shell, path: "scripts/installs/setup_rails_server.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
config.vm.provision :shell, path: "scripts/installs/install_rails_service.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Vulnerability - WebDAV
|
||||
# This must run after the WAMP setup.
|
||||
config.vm.provision :shell, path: "scripts/installs/setup_webdav.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Vulnerability - MySQL
|
||||
|
||||
config.vm.provision :shell, path: "scripts/installs/setup_mysql.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Vulnerability - ManageEngine Desktop Central
|
||||
config.vm.provision :shell, path: "scripts/installs/install_manageengine.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Vulnerability - Axis2
|
||||
# This must run after the Apache Struts setup.
|
||||
config.vm.provision :shell, path: "scripts/installs/setup_axis2.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Vulnerability - Common backdoors
|
||||
config.vm.provision :shell, path: "scripts/installs/install_backdoors.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Vulnerability - SNMP
|
||||
config.vm.provision :shell, path: "scripts/installs/setup_snmp.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Configure Firewall to open up vulnerable services
|
||||
case ENV['MS3_DIFFICULTY']
|
||||
when 'easy'
|
||||
config.vm.provision :shell, path: "scripts/configs/disable_firewall.bat"
|
||||
else
|
||||
config.vm.provision :shell, path: "scripts/configs/configure_firewall.bat"
|
||||
# Insecure share from the Linux machine
|
||||
win2k8.vm.provision :shell, path: "scripts/installs/install_share_autorun.bat"
|
||||
win2k8.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
win2k8.vm.provision :shell, path: "scripts/installs/setup_linux_share.bat"
|
||||
win2k8.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
end
|
||||
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
config.vm.define "ub1404" do |ub1404|
|
||||
ub1404.vm.box = "metasploitable-ub1404-pro"
|
||||
ub1404.vm.hostname = "metasploitable-ub1404"
|
||||
|
||||
# Vulnerability - ElasticSearch
|
||||
# This must run after the firewall rules, because it needs to make some HTTP requests in order to
|
||||
# set up the vulnerable state.
|
||||
config.vm.provision :shell, path: "scripts/installs/install_elasticsearch.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
ub1404.vm.network "private_network", ip: '172.28.128.3'
|
||||
|
||||
# Configure flags
|
||||
config.vm.provision :shell, path: "scripts/installs/install_flags.bat"
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614a
|
||||
end
|
||||
ub1404.vm.provider "virtualbox" do |v|
|
||||
v.name = "Metasploitable-ub1404"
|
||||
v.memory = 2048
|
||||
end
|
||||
|
||||
config.omnibus.chef_version = :latest
|
||||
|
||||
# Provision with Chef Solo
|
||||
#
|
||||
config.vm.provision :chef_solo do |chef|
|
||||
chef.cookbooks_path = [ 'chef/cookbooks' ]
|
||||
|
||||
chef.json = { 'metasploitable' => {
|
||||
# Customizations here
|
||||
}
|
||||
}
|
||||
|
||||
chef.add_recipe "metasploitable::mysql"
|
||||
chef.add_recipe "metasploitable::apache_continuum"
|
||||
chef.add_recipe "metasploitable::apache"
|
||||
chef.add_recipe "metasploitable::php_545"
|
||||
chef.add_recipe "metasploitable::phpmyadmin"
|
||||
chef.add_recipe "metasploitable::proftpd"
|
||||
chef.add_recipe "metasploitable::users"
|
||||
chef.add_recipe "metasploitable::docker"
|
||||
chef.add_recipe "metasploitable::samba"
|
||||
chef.add_recipe "metasploitable::sinatra"
|
||||
chef.add_recipe "metasploitable::unrealircd"
|
||||
chef.add_recipe "metasploitable::chatbot"
|
||||
chef.add_recipe "metasploitable::payroll_app"
|
||||
chef.add_recipe "metasploitable::readme_app"
|
||||
chef.add_recipe "metasploitable::cups"
|
||||
chef.add_recipe "metasploitable::drupal"
|
||||
chef.add_recipe "metasploitable::knockd"
|
||||
chef.add_recipe "metasploitable::iptables"
|
||||
chef.add_recipe "metasploitable::flags"
|
||||
chef.add_recipe "metasploitable::clear_cache"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,79 +0,0 @@
|
|||
{
|
||||
"builders": [
|
||||
{
|
||||
"type": "virtualbox-iso",
|
||||
"iso_url": "{{user `iso_url`}}",
|
||||
"iso_checksum_type": "{{user `iso_checksum_type`}}",
|
||||
"iso_checksum": "{{user `iso_checksum`}}",
|
||||
"headless": true,
|
||||
"boot_wait": "2m",
|
||||
"ssh_username": "vagrant",
|
||||
"ssh_password": "vagrant",
|
||||
"ssh_wait_timeout": "2h",
|
||||
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
|
||||
"guest_os_type": "Windows2008_64",
|
||||
"disk_size": 61440,
|
||||
"floppy_files": [
|
||||
"{{user `autounattend`}}",
|
||||
"./scripts/configs/microsoft-updates.bat",
|
||||
"./scripts/configs/win-updates.ps1",
|
||||
"./scripts/installs/openssh.ps1",
|
||||
"./resources/certs/oracle-cert.cer",
|
||||
"./resources/certs/gdig2.crt",
|
||||
"./resources/certs/comodorsadomainvalidationsecureserverca.crt",
|
||||
"./resources/certs/comodorsacertificationauthority.crt",
|
||||
"./resources/certs/addtrust_external_ca.cer",
|
||||
"./resources/certs/baltimore_ca.cer",
|
||||
"./resources/certs/digicert.cer",
|
||||
"./resources/certs/equifax.cer",
|
||||
"./resources/certs/globalsign.cer",
|
||||
"./resources/certs/gte_cybertrust.cer",
|
||||
"./resources/certs/microsoft_root_2011.cer",
|
||||
"./resources/certs/thawte_primary_root.cer",
|
||||
"./resources/certs/utn-userfirst.cer"
|
||||
],
|
||||
"vboxmanage": [
|
||||
[
|
||||
"modifyvm",
|
||||
"{{.Name}}",
|
||||
"--memory",
|
||||
"4096"
|
||||
],
|
||||
[
|
||||
"modifyvm",
|
||||
"{{.Name}}",
|
||||
"--cpus",
|
||||
"2"
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"provisioners": [
|
||||
{
|
||||
"type": "shell",
|
||||
"remote_path": "/tmp/script.bat",
|
||||
"execute_command": "{{.Vars}} cmd /c C:/Windows/Temp/script.bat",
|
||||
"scripts": [
|
||||
"./scripts/installs/vm-guest-tools.bat",
|
||||
"./scripts/configs/vagrant-ssh.bat",
|
||||
"./scripts/configs/disable-auto-logon.bat",
|
||||
"./scripts/configs/enable-rdp.bat",
|
||||
"./scripts/configs/update_root_certs.bat"
|
||||
]
|
||||
}
|
||||
],
|
||||
"post-processors": [
|
||||
{
|
||||
"type": "vagrant",
|
||||
"keep_input_artifact": false,
|
||||
"output": "windows_2008_r2_{{.Provider}}_pro.box",
|
||||
"vagrantfile_template": "vagrantfile-windows_2008_r2.template"
|
||||
}
|
||||
],
|
||||
"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": "./answer_files/2008_r2/Autounattend.xml"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue