Bug Squash 2

Writeup for Bug Squash (part 2) (Gamepwn) - 1337UP LIVE CTF (2024) ๐Ÿ’œ

Video walkthrough

VIDEO

Challenge Description

The developers learned some important things about cheaters and now hope they've learnt their lesson. Rumour has it, if you score more than 100,000 points in this game (within the 2 min time limit), you'll get a flag. Watch out for that new anti-cheat system though!

Solution

The description indicates we need more than 100,000 points to win, but there's a 2 minute time limit on each game ๐Ÿค”

We'll struggle to decompile the game as we did in part 1 due to it being compiled with IL2CPP instead of Mono. You could still attach cheat engine and reverse the code as DavidP did in this video (he actually reconstructed the C# code from assembly!)

My expected approach was to open Wireshark and see some network traffic when the game is running. Since the traffic is HTTPS, players have to do a little work to decrypt it.

  • Setup Windows proxy 127.0.0.1:8080

  • Setup burp cert to capture HTTPS traffic

    • Export proxy cert in PKCS format

    • Windows > Manage user certificates > Trusted Root Certification Authorities > Certificates > All Tasks > Import

    • Traffic will now show in burp

The /start_game endpoint will initialise a game.

Each time we score a point, a request is issued to the /update_score endpoint.

We can try to modify the traffic to change the points but from trial and error we will find some conditions

  • Anti-cheat resets users score if they send more then 3 request per second

  • Anti-cheat rejects any point values that aren't 1 (and resets score)

  • Anti-cheat checks that players score didn't jump to an unrealistic number (more than 4096 per request)

The game resets every 2 mins so by the anti-cheat rules, max attainable score is (120 * 3))

Since they can't change the value, I thought players might play around with the keys.

This would fail because the keys are duplicate. The thing about JSON is the keys are non case-sensitive, so I hoped players would try to send BUGS_SQUASHED as well asbugs_squashed and see they score points.

So yes, intended solution is to send {"user_id": "insert_id", "bugs_squashed": 1, "bUgs_squashed": 1, "buGs_squashed": 1} etc, where you can send 4096 variations per request at a max speed of 3 requests per second. Here's a solve script to do that.

solve.py

Run the solve script.

Flag: INTIGRITI{64m3_h4ck1n6_4n71ch347_15_4l50_fun!}

This challenge didn't get a lot of solves and people found it guessy. Thinking back on it, it was! I wish I did something different ๐Ÿ˜ž Here's the server-side code for those interested.

server.py

Last updated