Description
What's behind the numeric gate? Download `gatekeeper`, reverse the numeric checks, and enter the one value that passes.
Setup
Download the binary and make it executable.
Run it and observe what kind of input it expects.
chmod +x gatekeeper
./gatekeeper
Solution
- Step 1Run the binaryExecute gatekeeper and read the prompt. It asks for a number, and internally the program checks the input against a signed/unsigned boundary condition../gatekeeper
- Step 2Send -1 as the inputThe binary uses an unsigned comparison on a signed integer, so -1 (which wraps to 0xFFFFFFFF as uint32) satisfies the condition and passes the gate. Simply pipe -1 into the binary.echo '-1' | ./gatekeeper# Or on the remote instance:echo '-1' | nc <HOST> <PORT_FROM_INSTANCE>
- Step 3Read the flagThe gate opens and the binary prints the flag directly.
Flag
picoCTF{g4t3k33p3r_byp4ss_...}
The gatekeeper checks the input with a signed/unsigned integer mismatch -- passing -1 satisfies the unsigned comparison and bypasses the gate.