Apex › Security & web

How ROP bypasses NX

NX forbade running injected code — so return-oriented programming runs code that is already there. The overflow lays a chain of “gadget” addresses (short instruction sequences ending in ret, borrowed from the binary and libc) up the stack; each ret pops the next, turning the stack into a program. Step through a real chain that loads "/bin/sh" into the argument register and calls libc’s system() — arbitrary execution with no injected byte, defeating NX. Motivates ASLR.

More in Security & web