mirror of
https://github.com/cliffe/SecGen.git
synced 2026-02-21 19:28:02 +00:00
removing test code from binary_script_container
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user