diff --git a/Task 7 - The LD_PRELOAD Environment Variable and Set-UID Programs/libmylib.so.1.0.1 b/Task 7 - The LD_PRELOAD Environment Variable and Set-UID Programs/libmylib.so.1.0.1 new file mode 100755 index 0000000000000000000000000000000000000000..b6880c5541e3aeb3ee511f63bd8296482a229ca8 Binary files /dev/null and b/Task 7 - The LD_PRELOAD Environment Variable and Set-UID Programs/libmylib.so.1.0.1 differ diff --git a/Task 7 - The LD_PRELOAD Environment Variable and Set-UID Programs/mylib.c b/Task 7 - The LD_PRELOAD Environment Variable and Set-UID Programs/mylib.c new file mode 100644 index 0000000000000000000000000000000000000000..b11c22d3c0ac872ce145f3622bf7b11362189d50 --- /dev/null +++ b/Task 7 - The LD_PRELOAD Environment Variable and Set-UID Programs/mylib.c @@ -0,0 +1,9 @@ +#include <stdio.h> + +void sleep (int s) +{ + /* If this is invoked by a privileged program, + you can do damage here! */ + printf("I am not sleeping!\n"); +} + diff --git a/Task 7 - The LD_PRELOAD Environment Variable and Set-UID Programs/mylib.o b/Task 7 - The LD_PRELOAD Environment Variable and Set-UID Programs/mylib.o new file mode 100644 index 0000000000000000000000000000000000000000..8ce54c5527e4f8dc1362dade4dc2ff7c8bd13d64 Binary files /dev/null and b/Task 7 - The LD_PRELOAD Environment Variable and Set-UID Programs/mylib.o differ diff --git a/Task 7 - The LD_PRELOAD Environment Variable and Set-UID Programs/myprog.c b/Task 7 - The LD_PRELOAD Environment Variable and Set-UID Programs/myprog.c new file mode 100644 index 0000000000000000000000000000000000000000..010ea5c9212c91b8312a1d2c25c905b20492551c --- /dev/null +++ b/Task 7 - The LD_PRELOAD Environment Variable and Set-UID Programs/myprog.c @@ -0,0 +1,9 @@ +#include <unistd.h> +#include <stdlib.h> +/* myprog.c */ +int main() +{ +sleep(1); +system("printenv LD_PRELOAD"); +return 0; +}