Problem Overview
We are given a binary file and the source code. Let's look at the source code:
|
|
Some quick notes:
Similar to FormatString0, we have a custom
sigsegv
function that will output the flag on a segmentation fault- So, we just need to identify which buffer we can overflow
- The code is super simple, and it looks
strcpy
does not check if input exceeds the buffer size
Overflowing the Buffer
I am surprised this is labeled as a medium, we can simply just provide a large input to overflow the buffer to get the flag.
After supplying large input, we get the flag:
picoCTF{ov3rfl0ws_ar3nt_that_bad_c5ca6248}