Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.33 KB

README.md

File metadata and controls

52 lines (38 loc) · 1.33 KB

picoCTF 2022: RPS

Author: Will Hong

Binary_Exploitation category Score: 200 Solved

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 53296

The program's source code with the flag redacted can be downloaded here.

Hints

Hint 1 How does the program check if you won?

Summary

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.

Flag

Show flag
picoCTF{50M3_3X7R3M3_1UCK_8525F21D}