0x0 Introduction
gambler_supreme 50 PointsSOLVED
The Casino, but with a cool new feature!
You must create a flag.txt in the same folder as the binary for it to run.
nc ctf.b01lers.com 9201
Author: robotearthpizza
Difficulty: Hard
files: gambler_supreme
0x1 Mitigation
1 | Arch: amd64-64-little |
0x2 Vulnerability
it marks as hard but actually very easy.
function sym.casino
ask for a 4 byte string using gets
, then it compare with a random string generate by sym.imp.rand()
. In this challenge, the function for print out flag is not called in binary. So we need to control rip and jump to the function.
1 | │ ; var signed int64_t var_34h @ rbp-0x34 |
It have both gets
to overwrite and printf
to leak data.
using printf, we can leak canary.
then if we overwrite rip to give_flag
using gets
, the flag when be print when function return.
finally we uses gets
again, overwrite s1
, make format
and s1
same.
0x3 Exploit
1 | io = start() |
0x4 Flag
forgot