mirror of
https://github.com/rapid7/metasploitable3.git
synced 2024-09-21 00:01:14 +02:00
Make difficulty configurable
This commit is contained in:
parent
3acf75869c
commit
8c46a65605
26
Vagrantfile
vendored
26
Vagrantfile
vendored
|
@ -1,6 +1,24 @@
|
|||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
require 'getoptlong'
|
||||
|
||||
opts = GetoptLong.new(
|
||||
[ '--difficulty', GetoptLong::OPTIONAL_ARGUMENT ]
|
||||
)
|
||||
|
||||
difficulty = :normal
|
||||
|
||||
opts.each do |opt, arg|
|
||||
case opt
|
||||
when '--difficulty'
|
||||
case arg
|
||||
when /^easy$/i
|
||||
difficulty = :easy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
# Base configuration for the VM and provisioner
|
||||
config.vm.box = "metasploitable3"
|
||||
|
@ -108,7 +126,13 @@ Vagrant.configure("2") do |config|
|
|||
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
|
||||
config.vm.provision :shell, path: "scripts/configs/configure_firewall.bat"
|
||||
case difficulty
|
||||
when :easy
|
||||
config.vm.provision :shell, path: "scripts/configs/disable_firewall.bat"
|
||||
when :normal
|
||||
config.vm.provision :shell, path: "scripts/configs/configure_firewall.bat"
|
||||
end
|
||||
|
||||
config.vm.provision :shell, inline: "rm C:\\tmp\\vagrant-shell.bat" # Hack for this bug: https://github.com/mitchellh/vagrant/issues/7614
|
||||
|
||||
# Vulnerability - ElasticSearch
|
||||
|
|
Loading…
Reference in New Issue
Block a user