Created
June 12, 2015 13:09
-
-
Save shankaraman/24b601047700320f2043 to your computer and use it in GitHub Desktop.
Testing Binjitsu with Return to libc
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
/* | |
* Compile the binary as root | |
* $ chmod +s vuln | |
*/ | |
#include<stdio.h> | |
#include<unistd.h> | |
void c(); | |
void c(char *arg) | |
{ | |
char buggy[512]; | |
printf("Address of a(): %p\n", a); | |
printf("uid is:%u\teuid is:%u\n",getuid(),geteuid()); | |
strcpy(buggy,arg); | |
puts(buggy); | |
} | |
int main(int argc, char **argv) | |
{ | |
c(argv[1]); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment