Created
March 24, 2019 00:30
-
-
Save retpolanne/e56c5e5f06e450ffc9913dbd751edb9c to your computer and use it in GitHub Desktop.
Example code for buffer overflow vuln with gets
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
// To compile: gcc -fno-stack-protector -o boverflow_gets boverflow_gets.c | |
// To run (test): python -c "print 'a'*<some number>" | ./boverflow_gets | |
#include <stdio.h> | |
#include <string.h> | |
int main() { | |
char buffer[16]; | |
gets(buffer); | |
printf("%s", buffer); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment