Warmup
Binary Exploitation
Last updated
Binary Exploitation
Last updated
I actually didn't get to solve this challenge for the points, so I played this challenge just for practice. Given source code that looks like this:
I was able to know that this is a simple buffer overflow challenge, because the buf
variable stores only 20 chars yet the fgets
function reads 45 characters at maximum. We can solve this without using a debugger because it prints out the variable check for the overflow. So I tested the output with a cyclic pattern to find the offset until the variable gets overwritten.
We also know that the winning check requires check == 0x54524543
which is the same thing as inputting CERT
to the variable. Using this knowledge, I built a payload using python:
Using this payload I was able to solve the challenge to obtain the flag using the obtained shell.