diff --git a/atomics/T1548.001/T1548.001.yaml b/atomics/T1548.001/T1548.001.yaml index 5353b326..359fee45 100644 --- a/atomics/T1548.001/T1548.001.yaml +++ b/atomics/T1548.001/T1548.001.yaml @@ -77,18 +77,18 @@ atomic_tests: - linux input_arguments: payload: - description: hello.c payload + description: cap.c payload type: path - default: PathToAtomicsFolder/T1548.001/src/hello.c + default: PathToAtomicsFolder/T1548.001/src/cap.c executor: command: | - cp #{payload} /tmp/hello.c - sudo make /tmp/hello - sudo setcap cap_setuid=ep /tmp/hello - /tmp/hello + cp #{payload} /tmp/cap.c + sudo make /tmp/cap + sudo setcap cap_setuid=ep /tmp/cap + /tmp/cap cleanup_command: | - sudo rm /tmp/hello - sudo rm /tmp/hello.c + sudo rm /tmp/cap + sudo rm /tmp/cap.c name: sh elevation_required: true - name: Provide the SetUID capability to a file diff --git a/atomics/T1548.001/src/cap.c b/atomics/T1548.001/src/cap.c new file mode 100644 index 00000000..aaa1cdb0 --- /dev/null +++ b/atomics/T1548.001/src/cap.c @@ -0,0 +1,9 @@ +#include +#include +int main() +{ + sleep(5); + setuid(0); + printf("UID: %d\n", getuid()); + return 0; +}