-
Notifications
You must be signed in to change notification settings - Fork 169
/
rapid7-metasploitable3-win2k8.rb
30 lines (26 loc) · 1.17 KB
/
rapid7-metasploitable3-win2k8.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
def target(vconfig, custom)
vconfig.vm.define custom['name'], autostart: false do |target|
target.vm.box = 'rapid7/metasploitable3-win2k8'
target.vm.box_check_update = false
target.vm.hostname = 'metasploitable3-win2k8'
target.vm.communicator = 'winrm'
target.winrm.retry_limit = 60
target.winrm.retry_delay = 10
target.vm.synced_folder '.', '/vagrant', disabled: true
case ENV['MS3_DIFFICULTY']
when 'easy'
target.vm.provision :shell, inline: 'C:\\startup\\disable_firewall.bat'
else
target.vm.provision :shell, inline: 'C:\\\\startup\\\\enable_firewall.bat'
target.vm.provision :shell, inline: 'C:\\startup\\configure_firewall.bat'
end
target.vm.provision :shell, inline: 'C:\\startup\\install_share_autorun.bat'
target.vm.provision :shell, inline: 'C:\\\\startup\\\\setup_linux_share.bat'
target.vm.provision :shell, inline: 'rm C:\\startup\\*' # Cleanup startup scripts
target.vm.provider 'virtualbox' do |v|
v.customize ['modifyvm', :id, '--name', "pentest-env-#{custom['name']}"]
v.customize ['modifyvm', :id, '--memory', 2048]
v.customize ['modifyvm', :id, '--vrde', 'off']
end
end
end