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