mirror of
https://github.com/rapid7/metasploitable3.git
synced 2024-07-05 11:12:25 +02:00
Changes for community CTF.
This commit is contained in:
parent
86c5d2d71d
commit
23b71528fd
@ -47,54 +47,7 @@ file '/opt/docker/7_of_diamonds.zip' do
|
|||||||
action :delete
|
action :delete
|
||||||
end
|
end
|
||||||
|
|
||||||
if ENV['MS3_LINUX_HARD']
|
# Easy mode flags
|
||||||
# 5 of Diamonds
|
|
||||||
include_recipe 'metasploitable::knockd'
|
|
||||||
|
|
||||||
directory '/opt/knock_knock' do
|
|
||||||
mode '0700'
|
|
||||||
end
|
|
||||||
|
|
||||||
cookbook_file '/opt/knock_knock/five_of_diamonds' do
|
|
||||||
source 'flags/five_of_diamonds'
|
|
||||||
mode '0700'
|
|
||||||
end
|
|
||||||
|
|
||||||
cookbook_file '/etc/init/five_of_diamonds_srv.conf' do
|
|
||||||
source 'flags/five_of_diamonds_srv'
|
|
||||||
mode '0777'
|
|
||||||
end
|
|
||||||
|
|
||||||
service 'five_of_diamonds_srv' do
|
|
||||||
action [:enable, :start]
|
|
||||||
end
|
|
||||||
|
|
||||||
# 2 of Spades
|
|
||||||
cookbook_file '/home/leia_organa/2_of_spades.pcapng' do
|
|
||||||
source 'flags/2_of_spades.pcapng'
|
|
||||||
owner 'leia_organa'
|
|
||||||
mode '0600'
|
|
||||||
end
|
|
||||||
|
|
||||||
# 8 of Hearts
|
|
||||||
include_recipe 'metasploitable::mysql'
|
|
||||||
|
|
||||||
bash "load 8 of hearts into DB" do
|
|
||||||
code <<-EOH
|
|
||||||
mysql -h 127.0.0.1 --user="root" --password="sploitme" --execute="CREATE DATABASE super_secret_db;"
|
|
||||||
mysql -h 127.0.0.1 --user="root" --password="sploitme" --execute="GRANT SELECT, INSERT, DELETE, CREATE, DROP, INDEX, ALTER ON drupal.* TO 'root'@'localhost' IDENTIFIED BY 'sploitme';"
|
|
||||||
mysql -h 127.0.0.1 --user="root" --password="sploitme" super_secret_db < #{File.join(Chef::Config[:file_cache_path], 'cookbooks', 'metasploitable', 'files', 'flags', 'super_secret_db.sql')}
|
|
||||||
EOH
|
|
||||||
not_if "mysql -h 127.0.0.1 --user=\"root\" --password=\"sploitme\" --execute=\"SHOW DATABASES LIKE 'super_secret_db'\" | grep -c drupal"
|
|
||||||
end
|
|
||||||
|
|
||||||
# Joker - red
|
|
||||||
cookbook_file '/etc/joker.png' do
|
|
||||||
source 'flags/joker.png'
|
|
||||||
mode '0600'
|
|
||||||
end
|
|
||||||
|
|
||||||
else
|
|
||||||
# 10 of Spades
|
# 10 of Spades
|
||||||
include_recipe 'metasploitable::readme_app'
|
include_recipe 'metasploitable::readme_app'
|
||||||
|
|
||||||
@ -146,7 +99,52 @@ else
|
|||||||
execute 'build locate database' do
|
execute 'build locate database' do
|
||||||
command 'updatedb'
|
command 'updatedb'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Hard mode flags
|
||||||
|
if ENV['MS3_LINUX_HARD']
|
||||||
|
# 5 of Diamonds
|
||||||
|
include_recipe 'metasploitable::knockd'
|
||||||
|
|
||||||
|
directory '/opt/knock_knock' do
|
||||||
|
mode '0700'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
cookbook_file '/opt/knock_knock/five_of_diamonds' do
|
||||||
|
source 'flags/five_of_diamonds'
|
||||||
|
mode '0700'
|
||||||
|
end
|
||||||
|
|
||||||
|
cookbook_file '/etc/init/five_of_diamonds_srv.conf' do
|
||||||
|
source 'flags/five_of_diamonds_srv'
|
||||||
|
mode '0777'
|
||||||
|
end
|
||||||
|
|
||||||
|
service 'five_of_diamonds_srv' do
|
||||||
|
action [:enable, :start]
|
||||||
|
end
|
||||||
|
|
||||||
|
# 2 of Spades
|
||||||
|
cookbook_file '/home/leia_organa/2_of_spades.pcapng' do
|
||||||
|
source 'flags/2_of_spades.pcapng'
|
||||||
|
owner 'leia_organa'
|
||||||
|
mode '0600'
|
||||||
|
end
|
||||||
|
|
||||||
|
# 8 of Hearts
|
||||||
|
include_recipe 'metasploitable::mysql'
|
||||||
|
|
||||||
|
bash "load 8 of hearts into DB" do
|
||||||
|
code <<-EOH
|
||||||
|
mysql -h 127.0.0.1 --user="root" --password="sploitme" --execute="CREATE DATABASE super_secret_db;"
|
||||||
|
mysql -h 127.0.0.1 --user="root" --password="sploitme" --execute="GRANT SELECT, INSERT, DELETE, CREATE, DROP, INDEX, ALTER ON drupal.* TO 'root'@'localhost' IDENTIFIED BY 'sploitme';"
|
||||||
|
mysql -h 127.0.0.1 --user="root" --password="sploitme" super_secret_db < #{File.join(Chef::Config[:file_cache_path], 'cookbooks', 'metasploitable', 'files', 'flags', 'super_secret_db.sql')}
|
||||||
|
EOH
|
||||||
|
not_if "mysql -h 127.0.0.1 --user=\"root\" --password=\"sploitme\" --execute=\"SHOW DATABASES LIKE 'super_secret_db'\" | grep -c drupal"
|
||||||
|
end
|
||||||
|
|
||||||
|
# Joker - red
|
||||||
|
cookbook_file '/etc/joker.png' do
|
||||||
|
source 'flags/joker.png'
|
||||||
|
mode '0600'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@ -51,6 +51,6 @@
|
|||||||
"iso_url": "http://old-releases.ubuntu.com/releases/14.04.1/ubuntu-14.04.1-server-amd64.iso",
|
"iso_url": "http://old-releases.ubuntu.com/releases/14.04.1/ubuntu-14.04.1-server-amd64.iso",
|
||||||
"iso_checksum_type": "md5",
|
"iso_checksum_type": "md5",
|
||||||
"iso_checksum": "ca2531b8cd79ea5b778ede3a524779b9",
|
"iso_checksum": "ca2531b8cd79ea5b778ede3a524779b9",
|
||||||
"box_version": "0.1.12"
|
"box_version": "0.1.18"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,6 +125,6 @@
|
|||||||
"iso_url": "http://old-releases.ubuntu.com/releases/14.04.1/ubuntu-14.04.1-server-amd64.iso",
|
"iso_url": "http://old-releases.ubuntu.com/releases/14.04.1/ubuntu-14.04.1-server-amd64.iso",
|
||||||
"iso_checksum_type": "md5",
|
"iso_checksum_type": "md5",
|
||||||
"iso_checksum": "ca2531b8cd79ea5b778ede3a524779b9",
|
"iso_checksum": "ca2531b8cd79ea5b778ede3a524779b9",
|
||||||
"box_version": "0.1.5"
|
"box_version": "0.1.12"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user