From d804dd8bfba1bc86d356bf3c3de42bdea6d0eade Mon Sep 17 00:00:00 2001 From: thomashaw Date: Tue, 23 Feb 2021 00:27:08 +0000 Subject: [PATCH] 5_linux_stack_bof.xml: wip --- .../ctf/pwn/simple_bof/manifests/install.pp | 4 +- .../pwn/simple_bof/templates/exploit_me.c.erb | 3 +- .../5_linux_stack_bof.xml | 144 ++++++++++-------- 3 files changed, 88 insertions(+), 63 deletions(-) diff --git a/modules/vulnerabilities/unix/ctf/pwn/simple_bof/manifests/install.pp b/modules/vulnerabilities/unix/ctf/pwn/simple_bof/manifests/install.pp index b0cb74787..27a58fec0 100644 --- a/modules/vulnerabilities/unix/ctf/pwn/simple_bof/manifests/install.pp +++ b/modules/vulnerabilities/unix/ctf/pwn/simple_bof/manifests/install.pp @@ -1,8 +1,8 @@ class simple_bof::install { $secgen_parameters = secgen_functions::get_parameters($::base64_inputs_file) # $buffer_size = inline_template("<%= (3..8).sample ^ 2 %>") # randomised buffer size - $challenge_name = $secgen_parameters['challenge_name'][0] - $storage_dir = $secgen_parameters['storage_directory'][0] + # $challenge_name = $secgen_parameters['challenge_name'][0] + # $storage_dir = $secgen_parameters['storage_directory'][0] # Generate the C file (either in the home directory or the supplied storage_directory) $install_dir = '/root' diff --git a/modules/vulnerabilities/unix/ctf/pwn/simple_bof/templates/exploit_me.c.erb b/modules/vulnerabilities/unix/ctf/pwn/simple_bof/templates/exploit_me.c.erb index 0adb38e75..e5946108e 100644 --- a/modules/vulnerabilities/unix/ctf/pwn/simple_bof/templates/exploit_me.c.erb +++ b/modules/vulnerabilities/unix/ctf/pwn/simple_bof/templates/exploit_me.c.erb @@ -2,7 +2,8 @@ #include int main(int argc, char* argv[]) { - char buff[<%= @buffer_size %>]; + // char buff[<%#= @buffer_size %>]; + char buff[512]; strcpy(buff, argv[1]); printf("input:%s\n", buff); return 0; diff --git a/scenarios/labs/software_security_exploitation/5_linux_stack_bof.xml b/scenarios/labs/software_security_exploitation/5_linux_stack_bof.xml index 14ec80009..b6dbdae38 100644 --- a/scenarios/labs/software_security_exploitation/5_linux_stack_bof.xml +++ b/scenarios/labs/software_security_exploitation/5_linux_stack_bof.xml @@ -1,84 +1,108 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.github/cliffe/SecGen/scenario"> - Writing Exploits: Linux and Stack-smashing Buffer Overflows + Writing Exploits: Linux and Stack-smashing Buffer Overflows Thomas Shaw -[Lab sheet here](https://docs.google.com/document/d/1wgxLYHkdeLknRcbzZY73xZt36TWExuu-lfIJhRuHE-I/). - + [Lab sheet here](https://docs.google.com/document/d/1wgxLYHkdeLknRcbzZY73xZt36TWExuu-lfIJhRuHE-I/). + - ctf-lab + ctf-lab lab-sheet advanced - - linux_server - + + linux_server + - - - 172.16.0.2 - - 172.16.0.3 - + + + 172.16.0.2 + + 172.16.0.3 + - + - + - + - + + + + + + src_csp/Ch3.7-3.9/Ch3_07_ScanfOverflow + + + + + src_csp/Ch3.7-3.9/Ch3_07_CanaryBypass + + + + + src_csp/Ch3.7-3.9/Ch3_07_StackSmash + + + + + src_csp/Ch3.7-3.9/Ch3_07_HijackPLT + + + + - - - IP_addresses - - - + + + IP_addresses + + + - - kali - + + kali + - - {"username":"root","password":"toor","super_user":"","strings_to_leak":[],"leaked_filenames":[]} - + + {"username":"root","password":"toor","super_user":"","strings_to_leak":[],"leaked_filenames":[]} + - + - - - {"username":"root","password":"toor","super_user":"","strings_to_leak":[],"leaked_filenames":[]} - - - true - - - IP_addresses - - + + + {"username":"root","password":"toor","super_user":"","strings_to_leak":[],"leaked_filenames":[]} + + + true + + + IP_addresses + + - - - - - + + + + + - - - IP_addresses - - - + + + IP_addresses + + +