Last updated
Last updated
It gives us some sort of address, but what address? it Begins with 0xf7
, so likely an address in libc. We can step through in pwndbg and find that it's actually printing the address of system in libc. Since the challenge gives us their libc version, we can calcualate the libc base given the address of system and therefore the address of /bin/sh
.
This means we can make the program go to the address of system, with /bin/sh
as an argument(arguments are stored on the stack, just after the return address in 32-bit)
So, our exploit must:
Collect system address
Calculate libc version and address of /bin/sh
Use this to call system("/bin/sh")