Challenge Overview
Smash the stack
Can you overflow the buffer and modify the other local
variable? The program is available here. You can view source
here. And connect with it using: nc saturn.picoctf.net 64108
Solution
wget https://artifacts.picoctf.net/c/519/local-target
wget https://artifacts.picoctf.net/c/519/local-target.c
By looking at the source code, cat local-target.c, you can see that the goal is to get num to equal 65.
nc saturn.picoctf.net 64108
By running some tests knowing that you need to overflow you can get this string to get it to give 0:
"12345678901234567890123A"
Anything less would give 64. Anything more of different charaters gives varying numbers to num. When you add one more capital A it sets the number to 65 and gives the flag.
Flag: picoCTF{l0c4l5_1n_5c0p...8441a}