stepup
Beating ASLR again, using 64-bit this time.
Last updated
Beating ASLR again, using 64-bit this time.
Last updated
This binary is similar to the last one, so we'll be reusing most of the same techniques. This time, we'll need a way to pass the /bin/sh
address into rdi
, which will require a gadget to do this.
We'll do this the same way that we did it in the ROP chapter. We use ROPgadget
or ropper
to search for a gadget that will pop the top of the stack into rdi
:
This is perfect. We'll use this gadget to pop the address of /bin/sh
into rdi
before calling system()
.
This binary is nearly identical to the last one. We are provided the address of system()
, so we can just use that directly. Checking read_in
, we'll notice that it takes 40
bytes to reach the return pointer.
This is everything we need to write the exploit:
Running this gets our flag! We beat ASLR in 64-bit, which was no different than in 32-bit. The only difference is that we had to use 64-bit gadgets and addresses.