Last active
November 14, 2017 20:39
-
-
Save 0xTowel/8f2bfbc293a04a8263dc619d130da0a0 to your computer and use it in GitHub Desktop.
Naslr - A POC to start a bash shell with no ASLR via SYS_personality.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Naslr: Starts a bash shell with no ASLR | |
* Build: gcc naslr.c -o naslr | |
* | |
* Towel - 2017 | |
*/ | |
#include <sys/personality.h> | |
#include <syscall.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <err.h> | |
int main(int argc, char *argv[]) | |
{ | |
/* Syscall 0x87 - Set the process execution domain */ | |
((long)syscall(SYS_personality, 0x0040000)); | |
execv("/bin/bash", argv); | |
err(EXIT_FAILURE, "\n[!] Failed to start %s", "/bin/bash"); | |
return EXIT_FAILURE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment