Challenge description
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 53865
The program’s source code with the flag redacted can be downloaded here.
Category: Binary Exploitation
Solution
Since this is a binary exploitation challenge with the source code provided, I like to quickly scan over that first. A few things stood out.



The user can input anything, that input will be compared with the computer, which will randomly choose a hand from the loses
set. If you simply choose rock, paper, or scissors, you’ll have to rely on sheer luck to win 5 times in a row, which is rather unrealistic.
So instead, let’s cheat! Since there is no limit to what the user can input, nothing is preventing us from using rock, paper, AND scissors. Now, you are guaranteeing the computer would lose no matter what.
Here are some examples:




