Precision was the lowest point exploitation challenge because it was literally a buffer overflow :3
Let’s start by getting an idea what is up with it:
Alright, and the security mitigations it has:
Oh boy! No NX! So we can put shellcode into our payload :3
Oh man, we have a scanf that prompts us for our input and stores it in a static buffer.
If we look at the function prologue, we get an idea how big this buffer is:
The interesting part of this challenge comes from this part of main:
We see a lot of floating point operations and at the beginning of that code we see a floating point load from 0x8048690. Looking at the beginning of this function we see the same address again:
and it is storing the value in a stack based variable meaning it is most likely using this floating point value as a “stack cookie” more or less. So by simply getting the bytes of this floating point value and sticking them into our payload at the right offset as to align them with where the floating point value is located, we pass this check and get our exploit to land :3
Oh yeah, they also give us the address of our buffer in memory, so it is super easy peasy :3
Note
This script also includes an example of how to exfiltrate a libc in case you need it for a higher point problem :3