Instructions

Win a simple Card Game. Source. Connect on shell2017.picoctf.com:7253.

Hints

Bugs typically happen in groups. If yo ufind one, what does it allow you to do?

Solution

I'm actually really ticked off at this one, becuase I actually beat it. I honesly don't know how I did it. I saw the code, and decided to throw data at it, tracking it through the code. I eventually came accross setting my name to 32 A's (AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA), and betting 1 until eventually, it starting saying we both had a 0 of suit 0... I was perplexed but pushed on. Eventually, he would stay at suit 0 of suit 0, but I would get normal cards. I started betting the maximum, but when I reached the 500, 528 to be exact, it just says "You won the game! That's real impressive, seeing asthe deck was rigged... ; /bin/sh: 0: can't access tty; job control turned off". So, I won... but can't move on. So, yeah... I don't know what to do at this point, but I will puch further to see if I can actually find another exploit.

UPDATE: I'm an idiot. I did not realize it until I was working on it at lunch, but that's not an error message, that's an unlocking message. To get the flag, I did ls and then cat flag.txt. so, yeah.