Last active
June 1, 2016 23:12
-
-
Save gitpraetorianlabs/4e82168266e381ffe2cd1801b02b9362 to your computer and use it in GitHub Desktop.
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 <string.h> | |
#include <stdio.h> | |
//Simple BoF by b1ack0wl for E1550 | |
int main(int argc, char **argv[]){ | |
char buf[200] ="\0"; | |
if (argc < 2){ | |
printf("Usage: stack_bof_01 <argument>\r\n-By b1ack0wl\r\n"); | |
exit(1); | |
} | |
printf("Welcome to the first BoF exercise!\r\n\r\n"); | |
strcpy(buf, argv[1]); | |
printf("You entered %s \r\n", buf); | |
printf("Try Again\r\n"); | |
return 0x41; // Just so you can see what register is populated for return statements | |
} | |
void dat_shell(){ | |
printf("Congrats! I will now execute /bin/sh\r\n- b1ack0wl\r\n"); | |
system("/bin/sh -c"); | |
exit(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment