HyggeHalcyon
GithubLinkedIn
  • 🕊️whoami
  • 🚩CTFs
    • 2025
      • ARKAVIDIA Quals
      • TECHOMFEST Quals
    • 2024
      • BackdoorCTF
      • World Wide CTF
      • 7th Cyber Mimic Defense
      • TSA Cyber Champion
      • Cyber Jawara International
      • National Cyber Week Quals
      • COMPFEST 16 Finals
      • HackToday Finals
      • UIUCTF
      • TBTL CTF
      • BSidesSF CTF
      • UMD CTF
      • UMassCTF
      • b01lers CTF
      • AmateursCTF
      • UNbreakable International - Team Phase
    • 2023
      • HackToday CTF Quals
        • Vnote
        • TahuBulat
        • Rangkaian Digital
      • Tenable CTF
        • Skiddyana Pwnz and the Loom of Fate
        • Braggart
      • CiGITS
        • afafafaf
        • popping around shell
        • well_known
      • TJCTF
        • flip out
        • shelly
        • groppling-hook
        • formatter
        • teenage-game
      • SanDiegoCTF
        • money printer
        • turtle shell
      • DeadSec CTF
        • one punch
      • FindIT CTF Quals
        • Debugging Spiders
        • Everything Machine
        • Furr(y)verse
        • Bypass the Py
        • Joy Sketching in the Matrix
        • Detective Handal
        • I Like Matrix
        • CRYptograPI
        • Date Night
        • Web-Find IT
        • Mental Health Check
        • NCS Cipher
        • Discovered
  • 🔍NOTES
    • FSOP
      • Structures
      • GDB
      • Arbitrary Read/Write
      • Vtable Hijack
    • Heap Feng Shui
      • Libc Leak
    • Kernel Space
      • Privilege Escalation
      • Objects
      • Escaping Seccomp
    • V8
      • Documentation
      • TurboFan
      • SandBox (Ubercage)
  • 📚Resources
    • Cyber Security
      • General
      • Red Teaming
        • CheatSheet
        • Payload Database
        • Quality of Life
      • Binary Exploitation
        • Return Oriented Programming
        • File Structure Oriented Programming
        • Heap Exploitation
        • Linux Kernel Exploitation
        • Windows Exploitation
        • V8 Browser
      • Reverse Engineering
        • Windows Executable
        • Malware Analysis
        • Tools
      • Web Exploitation
      • Malware Development
      • Detection Engineering
      • Blockchain / Web3
      • Cryptography
    • Software Engineering
  • 📋Planning
    • Quick Notes
Powered by GitBook
On this page
  • Problem
  • Solution
  • Flag
  1. CTFs
  2. 2023
  3. FindIT CTF Quals

Joy Sketching in the Matrix

PreviousBypass the PyNextDetective Handal

Last updated 1 year ago

Problem

Description

Joy is a big fan of the Matrix. She has this DVD which contains hidden easter eggs from the actors of the Matrix, especially the 8x16 version. Can you find out the easter egg?

Note: Format flag adalah FindITCTF{string} dengan kapitalisasi sesuai seperti petunjuk (lowercase)

Solution

Initially when we take a look at the ‘chall’ file, the first thought was that it was some sort of hexdump of a binary file and we need to convert it to an executable before reversing it. And then there was a hunch telling that it was just a basic hex encoding applied to it. We then headed over to to decode it and our hunch quickly revealed that it's a source code.

By thoroughly inspecting the source code, it became evident that the code was an Arduino Sketch. Our analysis revealed that its purpose was to display content on an 8x16 LED matrix. To simplify the process, we considered an alternative approach using Python's Turtle module. Consequently, we swiftly developed a Python program utilising Turtle, which would dynamically move based on the input obtained from the cmd.txt file. u for moving upwards, d for down, r for right and l for left

From this point onward, most of the solution is handled by Aeryx since he has the most experience in terms of dealing with Arduino. Below is the python implementation code.

go_turtle_go.py
import turtle


def draw_text_formation(string_array):
   turtle.setup(width=1400, height=100)  # Set the window width to 1400 pixels


   turtle.hideturtle() # hide turtle
   turtle.speed(0)


   window_width = turtle.window_width() # Get the window width
   window_height = turtle.window_height() # Get the window height
   turtle.penup() # Pull the pen up
   # Set the initial position of the turtle
   turtle.goto(-window_width / 2 + 30, -window_height / 2 + 30)
   turtle.pendown() # Pull the pen down


   for string in string_array:
       start_position = turtle.position()  # Store the starting position of the string
      
       for char in string:
           if char == 'u':
               turtle.setheading(90)  # Face upwards
               turtle.forward(3)     # Move up by 3 units
           elif char == 'r':
               turtle.setheading(0)   # Face right
               turtle.forward(3)     # Move right by 3 units
           elif char == 'd':
               turtle.setheading(270) # Face downwards
               turtle.forward(3)     # Move down by 3 units
           elif char == 'l':
               turtle.setheading(180) # Face left
               turtle.forward(3)     # Move left by 3 units
      
       # Teleport to the right while maintaining the y-axis position
       turtle.penup()
       turtle.goto(start_position[0] + 30, start_position[1])
       turtle.pendown()
  
   turtle.done()


# read string from cmd file where splitted by new line
strings = []
with open('cmd.txt', 'r') as f:
   for line in f:
       strings.append(line.strip())


draw_text_formation(strings)

Flag

FindITCTF{etch_the_joysketch_in_the_matrix_zwquomf}

🚩
CyberChef
Sketch Output