Example of stack canary gdb bufdemo-protected (gdb) break echo Breakpoint 1 at 0x8048651 (gdb) break *0x8048672 Breakpoint 2 at 0x8048672 (gdb) run Breakpoint 1, 0x08048651 in echo () (gdb) stepi 2 0x0804865a in echo () (gdb) print /x $eax $1 = 0x3e37d00 # Canary (on other run, get 0x3ecb400) (gdb) cont Continuing. Type a string:12345 12345 Breakpoint 2, 0x08048672 in echo () (gdb) stepi 0x08048675 in echo () (gdb) print /x $eax $2 = 0x3e30035 # See corrupted value on stack (gdb) stepi 0x0804867c in echo () # Xor returns nonzero (gdb) print /x $eax $3 = 0x7d35 (gdb) stepi (gdb) stepi # Goes to failure routine