diff --git a/lib/helpers/constants.rb b/lib/helpers/constants.rb index b48b1f4ed..47e67d2d9 100644 --- a/lib/helpers/constants.rb +++ b/lib/helpers/constants.rb @@ -44,6 +44,7 @@ DOCUMENTATION_DIR = "#{ROOT_DIR}/documentation/yard/doc" # Path to resources WORDLISTS_DIR = "#{ROOT_DIR}/lib/resources/wordlists" +IMAGES_DIR = "#{ROOT_DIR}/lib/resources/images" # Path to secgen_functions puppet module SECGEN_FUNCTIONS_PUPPET_DIR = "#{MODULES_DIR}build/puppet/secgen_functions" diff --git a/lib/resources/images/Book.png b/lib/resources/images/Book.png new file mode 100644 index 000000000..b85f6f574 Binary files /dev/null and b/lib/resources/images/Book.png differ diff --git a/lib/resources/images/Building.png b/lib/resources/images/Building.png new file mode 100644 index 000000000..2a291775e Binary files /dev/null and b/lib/resources/images/Building.png differ diff --git a/lib/resources/images/Calculator.png b/lib/resources/images/Calculator.png new file mode 100644 index 000000000..7b086ce76 Binary files /dev/null and b/lib/resources/images/Calculator.png differ diff --git a/lib/resources/images/Camera.png b/lib/resources/images/Camera.png new file mode 100644 index 000000000..4471b9767 Binary files /dev/null and b/lib/resources/images/Camera.png differ diff --git a/lib/resources/images/Cutlery.png b/lib/resources/images/Cutlery.png new file mode 100644 index 000000000..e4e86c75a Binary files /dev/null and b/lib/resources/images/Cutlery.png differ diff --git a/lib/resources/images/Eye.png b/lib/resources/images/Eye.png new file mode 100644 index 000000000..ebc30d994 Binary files /dev/null and b/lib/resources/images/Eye.png differ diff --git a/lib/resources/images/File.png b/lib/resources/images/File.png new file mode 100644 index 000000000..2d2d1fb63 Binary files /dev/null and b/lib/resources/images/File.png differ diff --git a/lib/resources/images/Leaf.png b/lib/resources/images/Leaf.png new file mode 100644 index 000000000..84f0b8069 Binary files /dev/null and b/lib/resources/images/Leaf.png differ diff --git a/lib/resources/images/Lock.png b/lib/resources/images/Lock.png new file mode 100644 index 000000000..44ddf1d46 Binary files /dev/null and b/lib/resources/images/Lock.png differ diff --git a/lib/resources/images/Message.png b/lib/resources/images/Message.png new file mode 100644 index 000000000..1b06fe9f7 Binary files /dev/null and b/lib/resources/images/Message.png differ diff --git a/lib/resources/images/Moon.png b/lib/resources/images/Moon.png new file mode 100644 index 000000000..052970fdc Binary files /dev/null and b/lib/resources/images/Moon.png differ diff --git a/lib/resources/images/Snowflake.png b/lib/resources/images/Snowflake.png new file mode 100644 index 000000000..896cc525d Binary files /dev/null and b/lib/resources/images/Snowflake.png differ diff --git a/lib/resources/images/Sun.png b/lib/resources/images/Sun.png new file mode 100644 index 000000000..9f2007aa4 Binary files /dev/null and b/lib/resources/images/Sun.png differ diff --git a/lib/resources/images/Tree.png b/lib/resources/images/Tree.png new file mode 100644 index 000000000..c33145300 Binary files /dev/null and b/lib/resources/images/Tree.png differ diff --git a/modules/generators/image/random_image/manifests/.no_puppet b/modules/generators/image/random_image/manifests/.no_puppet new file mode 100644 index 000000000..e69de29bb diff --git a/modules/generators/image/random_image/random_image.pp b/modules/generators/image/random_image/random_image.pp new file mode 100644 index 000000000..e69de29bb diff --git a/modules/generators/image/random_image/secgen_local/local.rb b/modules/generators/image/random_image/secgen_local/local.rb new file mode 100644 index 000000000..8f47dfac2 --- /dev/null +++ b/modules/generators/image/random_image/secgen_local/local.rb @@ -0,0 +1,23 @@ +#!/usr/bin/ruby +require 'base64' +require_relative '../../../../../lib/objects/local_string_encoder.rb' +class ImageGenerator < StringEncoder + attr_accessor :selected_image_path + + def initialize + super + self.module_name = 'Random Image Generator' + self.selected_image_path = Dir["#{IMAGES_DIR}/*"].sample + end + + def encode_all + file_contents = File.binread(self.selected_image_path) + self.outputs << Base64.strict_encode64(file_contents) + end + + def encoding_print_string + 'Random image generator: ' + self.selected_image_path + end +end + +ImageGenerator.new.run \ No newline at end of file diff --git a/modules/generators/image/random_image/secgen_metadata.xml b/modules/generators/image/random_image/secgen_metadata.xml new file mode 100644 index 000000000..01f91b035 --- /dev/null +++ b/modules/generators/image/random_image/secgen_metadata.xml @@ -0,0 +1,19 @@ + + + + Random Image Generator + Thomas Shaw + MIT + Selects and outputs random image from the lib/resources/images directory in base64 format. + + image_generator + random_image + local_calculation + linux + windows + + base64_encoded_image + + \ No newline at end of file diff --git a/modules/vulnerabilities/unix/webapp/parameterised_website/manifests/install.pp b/modules/vulnerabilities/unix/webapp/parameterised_website/manifests/install.pp index e724eb0cb..5a2f8b043 100644 --- a/modules/vulnerabilities/unix/webapp/parameterised_website/manifests/install.pp +++ b/modules/vulnerabilities/unix/webapp/parameterised_website/manifests/install.pp @@ -12,7 +12,7 @@ class parameterised_website::install { $industry = $secgen_parameters['industry'][0] $product_name = $secgen_parameters['product_name'][0] $employees = $secgen_parameters['employees'] - $ctf_flags = $secgen_parameters['ctf_flags'] + $strings_to_leak = $secgen_parameters['strings_to_leak'] $main_page_paragraph_content = $secgen_parameters['main_page_paragraph_content'] $security_audit = $secgen_parameters['security_audit'] @@ -54,4 +54,10 @@ class parameterised_website::install { ensure => file, content => template('parameterised_website/contact.html.erb'), } + + $image_contents = $secgen_parameters['images_to_leak'][0] + file { "$docroot/image.png": + ensure => file, + content => base64('decode', $image_contents) + } } \ No newline at end of file diff --git a/modules/vulnerabilities/unix/webapp/parameterised_website/secgen_metadata.xml b/modules/vulnerabilities/unix/webapp/parameterised_website/secgen_metadata.xml index 3f2c33579..5e4918c96 100644 --- a/modules/vulnerabilities/unix/webapp/parameterised_website/secgen_metadata.xml +++ b/modules/vulnerabilities/unix/webapp/parameterised_website/secgen_metadata.xml @@ -13,7 +13,8 @@ remote linux - ctf_flags + strings_to_leak + images_to_leak business_name business_motto manager_profile @@ -29,11 +30,16 @@ host_acceptable_use_policy security_audit - + + + + + + diff --git a/modules/vulnerabilities/unix/webapp/parameterised_website/templates/index.html.erb b/modules/vulnerabilities/unix/webapp/parameterised_website/templates/index.html.erb index 212bf7529..d84ff48e9 100644 --- a/modules/vulnerabilities/unix/webapp/parameterised_website/templates/index.html.erb +++ b/modules/vulnerabilities/unix/webapp/parameterised_website/templates/index.html.erb @@ -1,6 +1,6 @@ <% $current_page = 'Homepage' %> - + <%= scope.function_template(['parameterised_website/subtemplates/header.html.erb']) %> <%= scope.function_template(['parameterised_website/subtemplates/navbar.html.erb']) %> diff --git a/modules/vulnerabilities/unix/webapp/parameterised_website/templates/subtemplates/main_container.html.erb b/modules/vulnerabilities/unix/webapp/parameterised_website/templates/subtemplates/main_container.html.erb index c0c7d6751..3ffa8f699 100644 --- a/modules/vulnerabilities/unix/webapp/parameterised_website/templates/subtemplates/main_container.html.erb +++ b/modules/vulnerabilities/unix/webapp/parameterised_website/templates/subtemplates/main_container.html.erb @@ -1,6 +1,9 @@
+ <% if @images_to_leak -%> + + <% end -%> <% # Intranet style -%> <% if @security_audit or @acceptable_use_policy -%>

Welcome to the internal intranet server for <%=@business_name%>.