Stack Pivoting

Stacking pivoting is a technique to use when you don't have enough stack space to perform normal ROP activities

For example:

char buf[64];

read(0,buf,72);

This only allows you to write 8 extra bytes after filling up the buffer which means there isn't enough to do a full ROP, meaning that you have to pivot through the stack to allow you to write more.

One of the ways this can be done is through a sub rsp; #; ret;

This subtracts the rsp back so you have more area to write in the stack meaning you can write your full ROP chain.

Last updated