A write-up of the Blackjack Python application security challenge from 5Charlie CTF.
Blackjack
Blackjack - Challenge
I created a program to play a very simple version of Black Jack, but my friend is winning way more than he should be! Can you take a look at my program and let me know what line my error is in? He said he found the bug after crashing the program…
The flag is the line of code the error is in ( eg. flag{##} )
Max 15 attempts, do not brute force it. We can see your submissions.
This challenge is a bit unique because it’s a minor logic error that could happen in the real-world after a refactor.
Luckily for us it calls attention to itself by virtue of changing program state on invalid input.
Notice this segment:
Invalid input really shouldn’t be affecting the program state except maybe in keeping track of errors.
Jumping back up we can see it has its effect in this segment:
By entering an invalid input between session, we are able to prevent the deck from being reshuffled.
This allows us to analyze the cards remaining and make more informed guesses as to the chances of winning.
The line reshuffle=2 should be removed.
Last year I wrote about using VLANs with VMWare Workstation with systemd-networkd.
A year later, I’m still actively using this process in my day to day workf...