2016-08-30 17:53:02 +02:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
|
|
|
Vagrant.configure("2") do |config|
|
2017-02-13 22:53:51 +01:00
|
|
|
config.vm.define "win2k8" do |win2k8|
|
|
|
|
# Base configuration for the VM and provisioner
|
|
|
|
win2k8.vm.box = "metasploitable3"
|
|
|
|
win2k8.vm.hostname = "metasploitable3"
|
|
|
|
win2k8.vm.communicator = "winrm"
|
2017-04-01 00:15:04 +02:00
|
|
|
win2k8.winrm.retry_limit = 60
|
|
|
|
win2k8.winrm.retry_delay = 10
|
2017-02-13 22:53:51 +01:00
|
|
|
|
|
|
|
win2k8.vm.network "private_network", type: "dhcp"
|
|
|
|
|
|
|
|
# Configure Firewall to open up vulnerable services
|
|
|
|
case ENV['MS3_DIFFICULTY']
|
2017-04-01 00:15:04 +02:00
|
|
|
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"
|
2017-02-13 22:53:51 +01:00
|
|
|
end
|
|
|
|
|
2017-04-07 21:33:30 +02:00
|
|
|
# Insecure share from the Linux machine
|
2017-05-02 18:07:48 +02:00
|
|
|
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
|
2017-04-07 21:33:30 +02:00
|
|
|
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
|
2016-10-28 23:04:22 +02:00
|
|
|
end
|
|
|
|
|
2017-02-13 22:53:51 +01:00
|
|
|
config.vm.define "trusty" do |trusty|
|
2017-03-13 23:34:45 +01:00
|
|
|
trusty.vm.box = "rsginc/ubuntu64-14-04-1"
|
2017-02-13 22:53:51 +01:00
|
|
|
trusty.vm.hostname = "metasploitableUB"
|
2016-08-30 17:53:02 +02:00
|
|
|
|
2017-04-07 21:33:30 +02:00
|
|
|
trusty.vm.network "private_network", ip: '172.28.128.3'
|
2016-10-26 20:33:56 +02:00
|
|
|
|
2017-02-13 22:53:51 +01:00
|
|
|
trusty.vm.provider "virtualbox" do |v|
|
|
|
|
v.name = "MetasploitableUB"
|
2017-06-22 00:15:42 +02:00
|
|
|
v.memory = 2048
|
2017-02-13 22:53:51 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
config.omnibus.chef_version = :latest
|
|
|
|
|
|
|
|
# Provision with Chef Solo
|
|
|
|
#
|
|
|
|
config.vm.provision :chef_solo do |chef|
|
|
|
|
chef.cookbooks_path = [ 'chef/cookbooks' ]
|
|
|
|
|
2017-03-15 23:59:51 +01:00
|
|
|
chef.json = { 'metasploitable' => {
|
2017-04-01 00:15:04 +02:00
|
|
|
# Customizations here
|
2017-07-13 01:15:48 +02:00
|
|
|
}
|
2017-04-01 00:15:04 +02:00
|
|
|
}
|
2017-02-13 22:53:51 +01:00
|
|
|
|
2017-07-13 19:57:31 +02:00
|
|
|
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"
|
2017-02-13 22:53:51 +01:00
|
|
|
chef.add_recipe "metasploitable::users"
|
2017-03-15 23:59:51 +01:00
|
|
|
chef.add_recipe "metasploitable::docker"
|
2017-04-04 00:06:40 +02:00
|
|
|
chef.add_recipe "metasploitable::samba"
|
2017-04-01 00:15:04 +02:00
|
|
|
chef.add_recipe "metasploitable::sinatra"
|
2017-04-06 20:19:21 +02:00
|
|
|
chef.add_recipe "metasploitable::unrealircd"
|
2017-04-17 18:45:23 +02:00
|
|
|
chef.add_recipe "metasploitable::chatbot"
|
2017-04-11 19:53:34 +02:00
|
|
|
chef.add_recipe "metasploitable::payroll_app"
|
2017-04-01 00:15:04 +02:00
|
|
|
chef.add_recipe "metasploitable::readme_app"
|
|
|
|
chef.add_recipe "metasploitable::cups"
|
2017-06-06 21:46:22 +02:00
|
|
|
chef.add_recipe "metasploitable::drupal"
|
2017-06-30 21:47:30 +02:00
|
|
|
chef.add_recipe "metasploitable::knockd"
|
|
|
|
chef.add_recipe "metasploitable::iptables"
|
|
|
|
chef.add_recipe "metasploitable::flags"
|
2017-07-20 22:44:38 +02:00
|
|
|
chef.add_recipe "metasploitable::clear_cache"
|
2017-02-13 22:53:51 +01:00
|
|
|
end
|
|
|
|
end
|
2017-07-13 01:15:48 +02:00
|
|
|
end
|