GateKeeper

This challenge provides a netcat connection that prompts us with the program. It asks us to enter a numeric code that must be greater than 999, but whenever we provide a number with more than three digits, it fails. By using Binary Ninja to disassemble the program, we can see that the input is checked to determine whether it is either decimal or hexadecimal. The condition shows that, in order to get the file, the input must satisfy the following constraints:
→ 999 < input < 99999 with a length of 3.

Since it is not possible to display a number greater than 999 in decimal and that the program accepts hex value, the logical answer is to provide a hex, here 0x3E8 (1000).

Since it is not possible to display a number greater than 999 in decimal using only three characters, and since the program accepts hexadecimal values, the logical solution is to provide a hexadecimal input, in this case 0x3E8 (1000).

After briefly analyzing the function, we can see that it uses putchar to print the characters of the flag, but in some cases it outputs ftc_oc_ip instead. By removing the extra characters, we find the flag!
