Created separate source code for setcap

This commit is contained in:
JChamblee99
2021-08-12 16:01:51 +00:00
parent ee19b9b165
commit fad21bdb42
2 changed files with 17 additions and 8 deletions
+8 -8
View File
@@ -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
+9
View File
@@ -0,0 +1,9 @@
#include <stdio.h>
#include <unistd.h>
int main()
{
sleep(5);
setuid(0);
printf("UID: %d\n", getuid());
return 0;
}