Heap Exploit for a new root user in /etc/passwd.
To run this on your system you can:
gcc exploit.c -o exploit
./exploit <execute of binary> <name of your binary>
A heap overflow or heap overrun is a type of buffer overflow that occurs in the heap data area. Heap overflows are exploitable in a different manner to that of stack-based overflows. Memory on the heap is dynamically allocated by the application at run-time and typically contains program data.(Source Wikipedia)