mirror of
https://github.com/rapid7/metasploitable3.git
synced 2024-06-28 15:55:47 +02:00
linux: add docker_daemon_privilege_escalation
Install docker from the community cookbook and add some users in the docker group from attributes. I created the `attributes/default.rb` attribute file to configure which users are added in the `docker` group. I suggest to put all configurable values here, such as users, passwords etc..
This commit is contained in:
parent
5d36ad0306
commit
dbe3947d22
5
Vagrantfile
vendored
5
Vagrantfile
vendored
|
@ -149,6 +149,10 @@ Vagrant.configure("2") do |config|
|
||||||
config.vm.provision :chef_solo do |chef|
|
config.vm.provision :chef_solo do |chef|
|
||||||
chef.cookbooks_path = [ 'chef/cookbooks' ]
|
chef.cookbooks_path = [ 'chef/cookbooks' ]
|
||||||
|
|
||||||
|
chef.json = { 'metasploitable' => {
|
||||||
|
# Customizations here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
chef.add_recipe "metasploitable::mysql"
|
chef.add_recipe "metasploitable::mysql"
|
||||||
chef.add_recipe "metasploitable::apache_continuum"
|
chef.add_recipe "metasploitable::apache_continuum"
|
||||||
|
@ -157,6 +161,7 @@ Vagrant.configure("2") do |config|
|
||||||
chef.add_recipe "metasploitable::phpmyadmin"
|
chef.add_recipe "metasploitable::phpmyadmin"
|
||||||
chef.add_recipe "metasploitable::proftpd"
|
chef.add_recipe "metasploitable::proftpd"
|
||||||
chef.add_recipe "metasploitable::users"
|
chef.add_recipe "metasploitable::users"
|
||||||
|
chef.add_recipe "metasploitable::docker"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
9
chef/cookbooks/metasploitable/attributes/default.rb
Normal file
9
chef/cookbooks/metasploitable/attributes/default.rb
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#
|
||||||
|
# Cookbook:: metasploitable
|
||||||
|
# Attributes:: default
|
||||||
|
#
|
||||||
|
|
||||||
|
default['metasploitable']['docker_users'] = ['boba_fett',
|
||||||
|
'jabba_hutt',
|
||||||
|
'greedo',
|
||||||
|
'chewbacca',]
|
|
@ -18,4 +18,5 @@ version '0.1.0'
|
||||||
#
|
#
|
||||||
# source_url 'https://github.com/<insert_org_here>/metasploitable3' if respond_to?(:source_url)
|
# source_url 'https://github.com/<insert_org_here>/metasploitable3' if respond_to?(:source_url)
|
||||||
|
|
||||||
|
depends 'docker'
|
||||||
depends 'mysql'
|
depends 'mysql'
|
||||||
|
|
15
chef/cookbooks/metasploitable/recipes/docker.rb
Normal file
15
chef/cookbooks/metasploitable/recipes/docker.rb
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#
|
||||||
|
# Cookbook:: metasploitable
|
||||||
|
# Recipe:: docker
|
||||||
|
#
|
||||||
|
|
||||||
|
docker_service 'default' do
|
||||||
|
action [:create, :start]
|
||||||
|
group 'docker'
|
||||||
|
end
|
||||||
|
|
||||||
|
group 'docker' do
|
||||||
|
action [:create, :modify]
|
||||||
|
append true
|
||||||
|
members node['metasploitable']['docker_users']
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user