Author: Will Hong
Here's a program that plays rock, paper, scissors against you. I hear something good happens if you win 5 times in a row.
Connect to the program with netcat:
$ nc saturn.picoctf.net 53296
The program's source code with the flag redacted can be downloaded here.
Hint 1
How does the program check if you won?The program checks the win using the following code:
if (strstr(player_turn, loses[computer_turn])) {
puts("You win! Play again?");
return true;
} else {
puts("Seems like you didn't win this time. Play again?");
return false;
}
We can see that it uses the function strstr
, which finds the first occurrence of a substring in a sting. So if we enter rockpaperscissors
it will always find the computers loosing command in our string.
Show flag
picoCTF{50M3_3X7R3M3_1UCK_8525F21D}