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]

Author: Yes

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

Attachment :

Solution

For this challenge, we get challenge.dcm file. We try to cat the inside of the file

We see some suspicious character here. From the index in the description, there are 32 character in the flag. But, we only see 26 character when we cat the file. So, i try to open it wih HxD

We see now that the file is start with WGMY, and every 8 or 12 byte, there is a character. We can extract all of the character and print it according to the hint

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[new_pos] = data[old_pos]

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