back to blog

Wargames.MY CTF 2024 — Misc: The DCM Meta (310 pts)

Description

[25, 10, 0, 3, 17, 19, 23, 27, 4, 13, 20, 8, 24, 21, 31, 15, 7, 29, 6, 1, 9, 30, 22, 5, 28, 18, 26, 11, 2, 14, 16, 12]

Hint: The element is the number in the list, combine for the flag. Wrap in wgmy{}

Solution

We got a challenge.dcm file. Running cat on it shows some suspicious characters — but only 26, while the index has 32 positions. Opening in HxD reveals the file starts with WGMY, and every 8–12 bytes hides a character.

Extracting all characters and reordering them by the hint’s index:

data = "f63acd3b78127c1d7d3e700b55665354"

indices = [25, 10, 0, 3, 17, 19, 23, 27, 4, 13, 20, 8, 24, 21, 31, 15, 7, 29, 6, 1, 9, 30, 22, 5, 28, 18, 26, 11, 2, 14, 16, 12]

result = [''] * len(indices)
for new_pos, old_pos in enumerate(indices):
    if old_pos < len(data):
        result[old_pos] = data[new_pos]

flag = 'wgmy{' + ''.join(result) + '}'
print(flag)

Flag

wgmy{3e5a7b372766483d5c5d1c037f6b5d01}