🔬
CTFs
  • 🚩nitrozeus's CTF Writeups
  • Tutorial
    • Install Windows 10 VM on M1 Mac
  • My Notes
    • Capture-The-Flag
      • Windows Forensics
      • Memory Forensics
      • Base32, Base64
      • Steganography
      • Email Analysis
      • Malware Analysis
      • MD4, MD5 Cracking
      • Social Engineering
      • OSINT
      • Google Dorking
      • Reconnaissance
      • Port Scan (nmap)
  • 2023
    • 🧠BrainHack CDDC 2023
      • Gallery
      • Eazy Network Analysis
      • What the hell happened to the PC?!
      • Audio Steganography
  • 2022
    • 🐱Grey Cat The Flag 2022
      • Parcel
      • Memory Game (Part 1)
      • Too Fast
      • Entry
      • Ghost
      • Firmware
      • Image Upload
      • flappy-js
    • ⛵STANDCON 2022
      • I Sea You (Part 1)
      • Locate Me
      • I Sea You (Part 2)
      • Trolley Trolling
      • A New Gateway
      • Walks like a cat, barks like a dog
      • Shark in the Ocean
      • Atlan Safe P1
      • Gift from Russia
      • Asmuth Shares
      • Memedump
      • Warmup Forensics
    • 🦁STACK the Flags 2022
      • Finding Nyan
      • New Task!
      • Hit you with that
      • Cobalt Struck
      • PyRunner
Powered by GitBook
On this page
  • Solution 1
  • Solution 2
  1. 2022
  2. Grey Cat The Flag 2022

flappy-js

flappy bird clone.

PreviousImage UploadNextSTANDCON 2022

Last updated 2 years ago

Are you a pro gamer? Can you get a score of 31337 in this game?

(flag format is greyctf{...} because I made a mistake :p)

Author: daniellimws

We were given a site called "Clumsy Bird" which is essentially a Flappy Bird clone. There are TWO ways to solve this challenge. I will be explaining both of them!

Solution 1

<!-- melonJS Library -->
<script type="text/javascript" src="js/melonJS-min.js" ></script>
<script type="text/javascript" src="build/clumsy-min.js" ></script>
<script type="text/javascript">
    window.onReady(function onReady() {
        game.onload();
    });
</script>
draw: function (a) {
  game.data.start && me.state.isCurrent(me.state.PLAY) 
  && (
    this.stepsFont.draw(a, game.data.steps, me.game.viewport.width / 2, 10), 
  game.data.steps >= 31337 
  && (
    0 == this.flag.length && (this.flag = genFlag()), 
    this.flagFont = new me.Font('roboto', 35, '#000', 'center'), 
    this.flagFont.draw(a, 'greyctf{' + this.flag + '}', me.game.viewport.width / 2, 110)))
}

From the JavaScript code snippet, we can see that we need to call genFlag() in order to get the flag, and so we did via Firefox Browser Console!

Flag: greyctf{5uch_4_pr0_g4m3r}

Solution 2

Using the same JavaScript code snippet, we noticed the object game.data.steps >= 31337 and so we went to the Firefox Browser Console and ran game.data first, just to see what was the output.

We noticed the steps variable, and since the challenge wants us to get a score of 31337 and above, we then ran game.data.steps = 31337

Take Note: The game will pause when you tap onto the Firefox Developer Tools.

To ensure that Solution 2 works, be sure to pause the game before your Flappy Bird hits the floor, enter the command and then resume the game!

Flag: greyctf{5uch_4_pr0_g4m3r}

When we were given the to the Clumsy Bird challenge, the first thing we did was "View Page Source". From there, we were able to see TWO scripts being loaded.

is just a standard HTML5 game engine library, so we looked at clumy-min.js and searched for the string "flag" via .

I'm in this photo and I don't like it!

🐱
😡
link
melonJS
Firefox Developer Tools
🎉
much wow, such clone!
take note of genFlag()
We got the flag!!!