August 30, 2017

pwnable.kr blackjack solution


Hey! check out this C implementation of blackjack game!
I found it online

I like to give my flags to millionares.
how much money you got?





It is a non-special CLI based blackjack game. If you win the game, you can get the rewards you have bet.

but two little strange thing is in the above code. There is no lower limit for "(bet > cash)" and tere is no upper&lower limit for "scanf('%d', &bet);".





This game is designed that the "cash" is added when you win and the opposite case the "cash" is subtracted.

So, there are two strategy.
1. (losing in the game) + (A large negative value)
2. (win in the game) + (A large positive value at second input)





Anyway, I became a millionaire and the key is provided.