Challenge Source: Defcon 28 - Red Team Village CTF
Challenge Category: programming
Programming - Roll for Initiative 1
When connecting to the server, the “Backdoors and Breaches” game begins and we need to “Roll for Initiative”:
Experimenting a bit we find:
An integer between 1 and 20 needs to be provided as an input.
The number needs to match an expected value.
If it does we’re asked to “Roll again” and provide another input. We’re told that doing this 10 times will result in a “prize” which we can hope is the flag.
If it does not, we’re told it does not match, what the number should have been and the connection is broken.
The expected numbers and their order do not change when we re-establish a connection to the server.
Our code therefore needs to open a connection to the server, submit some values, keep track of the correct values, restart the connect when an incorrect value is submitted, and find the flag, which we know will probably have ‘{‘ in it.