Created
August 29, 2017 21:42
-
-
Save rkujawa/366a3225fb444cfa260acb037e09c8a3 to your computer and use it in GitHub Desktop.
fooapp - C source
This file contains 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
#include <stdio.h> | |
#include <unistd.h> | |
int | |
main(int argc, char *argv) | |
{ | |
printf("let's try to run execve!\n"); | |
execve("/bin/sh", 0, 0); | |
/* if we are here, it means execve failed in some way */ | |
perror("couldn't execve: "); | |
} | |
/* | |
$ fooapp | |
let's try to run execve! | |
couldn't execve: : Permission denied | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment