Skip to content

Instantly share code, notes, and snippets.

@fgsahoward
Created June 11, 2018 14:13
Show Gist options
  • Save fgsahoward/c6ec05badded1111d3163ef7375a2d3b to your computer and use it in GitHub Desktop.
Save fgsahoward/c6ec05badded1111d3163ef7375a2d3b to your computer and use it in GitHub Desktop.
/** Easily exploitable Buffer Overflow for learning purposes
*
* Compilation:
* gcc -fno-stack-protector -z execstack -m32 -o easy easy.c
**/
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
void vulnerable(char * input) {
char buffer[1024];
strcpy(buffer, input);
printf("Input: %s\n", buffer);
}
int main (int argc, char * argv[]) {
if (argc != 2)
exit(1);
vulnerable(argv[1]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment