From 0e5861eee37cd3abbf10f9603f009b0bb7ce3459 Mon Sep 17 00:00:00 2001 From: Brendan Malone <46428809+RoundBunny@users.noreply.github.com> Date: Mon, 27 Jun 2022 15:01:59 -0500 Subject: [PATCH] Added chown script --- atomics/T1222.002/T1222.002.yaml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/atomics/T1222.002/T1222.002.yaml b/atomics/T1222.002/T1222.002.yaml index b7000d62..2c529bc8 100644 --- a/atomics/T1222.002/T1222.002.yaml +++ b/atomics/T1222.002/T1222.002.yaml @@ -211,5 +211,33 @@ atomic_tests: gcc #{source_file} -o #{compiled_file} executor: command: | - /tmp/T1222002 /tmp/ T1222002 + #{compiled_file} /tmp/ T1222002 name: sh +- name: Chown through c script + description: | + chowns a file to root using a c script + supported_platforms: + - macos + - linux + input_arguments: + source_file: + description: Path of c source file + type: Path + default: PathToAtomicsFolder/T1222.002/src/chown.c + compiled_file: + description: Path of compiled file + type: Path + default: /tmp/T1222002own + dependency_executor_name: sh + dependencies: + - description: | + Compile the script from (#{source_file}). Destination is #{compiled_file} + prereq_command: | + gcc #{source_file} -o #{compiled_file} + get_prereq_command: | + gcc #{source_file} -o #{compiled_file} + executor: + command: | + sudo #{compiled_file} #{source_file} + name: sh + elevation_required: true