Land #388, add parallels provider support for ub1404 and win2k8
This commit is contained in:
commit
5be08b96ba
|
@ -36,7 +36,7 @@ Requirements:
|
||||||
* [Packer](https://www.packer.io/intro/getting-started/install.html)
|
* [Packer](https://www.packer.io/intro/getting-started/install.html)
|
||||||
* [Vagrant](https://www.vagrantup.com/docs/installation/)
|
* [Vagrant](https://www.vagrantup.com/docs/installation/)
|
||||||
* [Vagrant Reload Plugin](https://github.com/aidanns/vagrant-reload#installation)
|
* [Vagrant Reload Plugin](https://github.com/aidanns/vagrant-reload#installation)
|
||||||
* [VirtualBox](https://www.virtualbox.org/wiki/Downloads), libvirt/qemu-kvm, or vmware (paid license required)
|
* [VirtualBox](https://www.virtualbox.org/wiki/Downloads), libvirt/qemu-kvm, or vmware (paid license required), or parallels (paid license required)
|
||||||
* Internet connection
|
* Internet connection
|
||||||
|
|
||||||
### To build automatically:
|
### To build automatically:
|
||||||
|
|
7
build.sh
7
build.sh
|
@ -5,6 +5,7 @@ min_vagrant_ver="1.9.0"
|
||||||
min_packer_ver="0.10.0"
|
min_packer_ver="0.10.0"
|
||||||
min_vagrantreload_ver="0.0.1"
|
min_vagrantreload_ver="0.0.1"
|
||||||
min_vagrantvmware_ver="0.0.1"
|
min_vagrantvmware_ver="0.0.1"
|
||||||
|
min_vagrantparallels_ver="0.0.1"
|
||||||
min_vagrantlibvirt_ver="0.0.1"
|
min_vagrantlibvirt_ver="0.0.1"
|
||||||
packer_bin="packer"
|
packer_bin="packer"
|
||||||
packer_build_path="packer/builds"
|
packer_build_path="packer/builds"
|
||||||
|
@ -125,6 +126,12 @@ if compare_versions $(vagrant plugin list | grep 'vagrant-vmware' | cut -d' ' -f
|
||||||
providers="vmware $providers"
|
providers="vmware $providers"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if compare_versions $(vagrant plugin list | grep 'vagrant-parallels' | cut -d' ' -f2 | tr -d '(' | tr -d ')' | tr -d ',') $min_vagrantparallels_ver false; then
|
||||||
|
echo 'Compatible version of vagrant-parallels plugin was found.'
|
||||||
|
echo 'Parallels image will be built'
|
||||||
|
providers="parallels $providers"
|
||||||
|
fi
|
||||||
|
|
||||||
if compare_versions $(vagrant plugin list | grep 'vagrant-reload' | cut -d' ' -f2 | tr -d '(' | tr -d ')' | tr -d ',') $min_vagrantreload_ver false; then
|
if compare_versions $(vagrant plugin list | grep 'vagrant-reload' | cut -d' ' -f2 | tr -d '(' | tr -d ')' | tr -d ',') $min_vagrantreload_ver false; then
|
||||||
echo 'Compatible version of vagrant-reload plugin was found.'
|
echo 'Compatible version of vagrant-reload plugin was found.'
|
||||||
else
|
else
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#
|
||||||
|
# Cookbook:: metasploitable
|
||||||
|
# Recipe:: ifnames
|
||||||
|
#
|
||||||
|
|
||||||
|
# block udev persistent net rules for consistent interface naming after cloning
|
||||||
|
link '/etc/udev/rules.d/75-persistent-net-generator.rules' do
|
||||||
|
to '/dev/null'
|
||||||
|
end
|
|
@ -1,5 +1,38 @@
|
||||||
{
|
{
|
||||||
"builders": [
|
"builders": [
|
||||||
|
{
|
||||||
|
"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,
|
||||||
|
"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",
|
||||||
|
"disk_size": 40000,
|
||||||
|
"vm_name": "metasploitable3-ub1404",
|
||||||
|
"parallels_tools_flavor": "lin",
|
||||||
|
"cpus": 2,
|
||||||
|
"memory": 4096
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "vmware-iso",
|
"type": "vmware-iso",
|
||||||
"iso_url": "{{user `iso_url`}}",
|
"iso_url": "{{user `iso_url`}}",
|
||||||
|
@ -147,7 +180,8 @@
|
||||||
"metasploitable::drupal",
|
"metasploitable::drupal",
|
||||||
"metasploitable::knockd",
|
"metasploitable::knockd",
|
||||||
"metasploitable::iptables",
|
"metasploitable::iptables",
|
||||||
"metasploitable::flags"
|
"metasploitable::flags",
|
||||||
|
"metasploitable::ifnames"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,5 +1,44 @@
|
||||||
{
|
{
|
||||||
"builders": [
|
"builders": [
|
||||||
|
{
|
||||||
|
"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",
|
||||||
|
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
|
||||||
|
"guest_os_type": "win-2008",
|
||||||
|
"parallels_tools_flavor": "win",
|
||||||
|
"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",
|
||||||
|
"cpus": 2,
|
||||||
|
"memory": 4096
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "vmware-iso",
|
"type": "vmware-iso",
|
||||||
"iso_url": "{{user `iso_url`}}",
|
"iso_url": "{{user `iso_url`}}",
|
||||||
|
|
Loading…
Reference in New Issue