This repository contains the example files and LiveCD Image from the book: Hacking - The Art of Exploitation by Jon Erickson.
The VM is an Ubuntu-based Live Linux Distribution and it already includes all of the source code.
The code compiles under GCC version 3.3.6
.
It's also worth noting that much of the exploits won't work under GCC 4 with the buffer overflow detection. Instead of stack-smashing and moving on, it will detect buffer overflows and seg fault without overflowing the buffers. Is recommended using the VM to play with the exploits.
Please note that the examples are not production code and have not been carefully testing. They are provided "as-is" and come with no warranty of any kind.