From e1df8957fc0fe4e62e19746c61d83958237efbd6 Mon Sep 17 00:00:00 2001 From: ts Date: Fri, 3 Aug 2018 11:11:54 +0100 Subject: [PATCH] removing test code from binary_script_container --- .../manifests/install.pp | 39 +------------------ .../templates/Crackme.java.erb | 29 -------------- 2 files changed, 2 insertions(+), 66 deletions(-) delete mode 100644 modules/vulnerabilities/unix/ctf/ruby_challenge_example/templates/Crackme.java.erb diff --git a/modules/utilities/unix/system/binary_script_container/manifests/install.pp b/modules/utilities/unix/system/binary_script_container/manifests/install.pp index 5f025e535..ac90c0811 100644 --- a/modules/utilities/unix/system/binary_script_container/manifests/install.pp +++ b/modules/utilities/unix/system/binary_script_container/manifests/install.pp @@ -1,7 +1,7 @@ class binary_script_container::install { # Create temp install directory - file { '/root/tmp': + file { '/root/suid/': ensure => directory, } @@ -14,43 +14,8 @@ class binary_script_container::install { # Make and install exec { "wrapper make install": command => 'make suid; install -m a+rx,u+ws -s ./suid /usr/local/bin/suid', - cwd => '/root/tmp', + cwd => '/root/suid/', path => '/bin:/sbin:/usr/bin:/usr/sbin', } - # Create group for test TODO: remove me - group { 'test': - ensure => present - } - - file { '/home/tmp': - ensure => directory, - } - - # Move test file onto box TODO: remove me - file { "/home/tmp/test.sh": - ensure => file, - source => 'puppet:///modules/binary_script_container/test.sh', - group => 'test', - mode => '2775', - require => [Group['test'],File['/home/tmp']], - } - - - # Test: add a flag file with a group TODO: remove me - ::secgen_functions::leak_files { "flag-file-leak": - storage_directory => "/home/tmp/", - leaked_filenames => ['flag'], - strings_to_leak => ['flag{wayy!!!}'], - owner => 'root', - group => 'test', - mode => '0440', - leaked_from => "binary_script_container_flag", - require => [Group['test'], File["/home/tmp/test.sh"]], - } - - - # Remove temp install directory - - } \ No newline at end of file diff --git a/modules/vulnerabilities/unix/ctf/ruby_challenge_example/templates/Crackme.java.erb b/modules/vulnerabilities/unix/ctf/ruby_challenge_example/templates/Crackme.java.erb deleted file mode 100644 index 39b6f8ed4..000000000 --- a/modules/vulnerabilities/unix/ctf/ruby_challenge_example/templates/Crackme.java.erb +++ /dev/null @@ -1,29 +0,0 @@ -import java.io.PrintStream; -import java.util.Scanner; - -public class Crackme -{ - public Crackme() - { - } - - public static void main(String args[]) - { - System.out.println("Please enter the password:"); - Scanner scanner = new Scanner(System.in); - String s = scanner.next(); - if(s.equals("<%= @password %>")) - { - System.out.println("Correct"); - System.out.print("Your key is: "); - <% @flag.split('').each do |char|-%> - System.out.print("<%= char %>"); - <% end %> - System.out.print("\n"); - } - else - { - System.out.println("Wrong"); - } - } -} \ No newline at end of file