Flash CTF – Wheel of Mystery

Overview

To solve this CTF challenge, you can use the provided rotating wheel to decrypt the ciphertext RKPUYPFCIAKKJMYZZJT. The flag will be in the format MetaCTF{.*}. Here’s a step-by-step approach to solve it:

  1. Understand the Wheel: The wheel has two concentric circles of characters. The outer circle is fixed, and the inner circle rotates. Each position of the inner circle corresponds to a different substitution cipher.
  2. Identify the Flag Format: Since the flag format is MetaCTF{.*}, you can use this known prefix to help identify the correct rotation.
  3. Brute Force the Rotations: You will need to try each possible rotation of the inner wheel and check if the decrypted text starts with METACTF{.
  4. Decrypt the Ciphertext: For each rotation, map each character of the ciphertext to the corresponding character on the outer wheel. Here’s a Python script to automate this process:
def decrypt(ciphertext, outer_wheel, inner_wheel):
    decrypted_text = ""
    for char in ciphertext:
        if char in outer_wheel:
            index = outer_wheel.index(char)
            decrypted_text += inner_wheel[index]
        else:
            decrypted_text += char
    return decrypted_text

def find_flag(ciphertext, outer_wheel, inner_wheel):
    for rotation in range(len(inner_wheel)):
        rotated_inner_wheel = inner_wheel[rotation:] + inner_wheel[:rotation]
        decrypted_text = decrypt(ciphertext, outer_wheel, rotated_inner_wheel)
        #print(decrypted_text)
        if decrypted_text.startswith("METACTF{"):
            return decrypted_text
    return None

# Define the wheels
outer_wheel = "ABCDEFGHIJKLMNOPQRSTUVWXYZ{}"
inner_wheel = "QNFUVWLEZYXPTKMR}ABJICOSDHG{"

# Ciphertext
ciphertext = "RKPUYPFCIAKKJMYZZJT"

# Find the flag
flag = find_flag(ciphertext, outer_wheel, inner_wheel)
if flag:
    print(f"Flag found: {flag}")
else:
    print("Flag not found")

Explanation:

  1. decrypt function: This function takes the ciphertext and the current rotation of the inner wheel and decrypts the text by mapping each character of the ciphertext to the corresponding character on the inner wheel.
  2. find_flag function: This function iterates through all possible rotations of the inner wheel. For each rotation, it decrypts the ciphertext and checks if the decrypted text starts with MetaCTF{. If it does, it returns the decrypted text as the flag.
  3. Define the wheels: The outer wheel is fixed as ABCDEFGHIJKLMNOPQRSTUVWXYZ{}. The inner wheel is given as QNFUVWLEZYXPTKMR}ABJICOSDHG{.
  4. Ciphertext: The given ciphertext is RKPUYPFCIAKKJMYZZJT.
  5. Find the flag: The script tries all possible rotations and prints the flag if found. Run this script, and it will output the correct flag by trying all possible rotations of the inner wheel.

Flag: METACTF{WHEELYCOOL}


MetaCTF

Our goal is to make cybersecurity education accessible and fun.

Products

Copyright: © 2024 MetaCTF. All Rights Reserved.

Terms of Use       Privacy Policy       Contact Us