diff --git a/build_wrapper.sh b/build_wrapper.sh new file mode 100644 index 0000000..9f05099 --- /dev/null +++ b/build_wrapper.sh @@ -0,0 +1 @@ +gcc wrapper.c -o wrapper \ No newline at end of file diff --git a/wrapper.c b/wrapper.c new file mode 100644 index 0000000..a39737a --- /dev/null +++ b/wrapper.c @@ -0,0 +1,16 @@ +#include +#include +#include +#include + +int main(int argc, char *argv[]) { + // Drop privileges before running the command + setuid(getuid()); + + // Pass all arguments to the target command + execvp(argv[1], &argv[1]); + + // This is only reached if execvp fails + perror("execvp"); + return 1; +}