This is a simple buffer overflow I coded in C programming language.
In order to execute this one , save this file with .c extension since it's a file written in C.
After that, use the terminal to navigate to the path where you saved the file.
Type this:
gcc file.c
Now type:
./a.out
Now you are able to type a string of any size and you'll get your Buffer Overflow executed.
Be aware that I do not have any responsability in case you use this code in the wrong way.