From e5506353cb6eabc3cb2fa7e37e08b4720d1c3ab4 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Thu, 23 Oct 2025 01:12:43 -0600 Subject: [PATCH] 1761203563 --- build_wrapper.sh | 1 + wrapper.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 build_wrapper.sh create mode 100644 wrapper.c 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; +}