Featured image of post Write-Up Space InterIUT 2k19

Write-Up Space InterIUT 2k19

Write-up of the steganography challenge presented at the CTF InterIUT 2020.

Write-Up

This is a multi-step challenge:

When you open the file, you are faced with an empty document. On closer inspection, we realise that there are many spaces, tabs and line breaks. One can immediately think of Whitespace language. After a few inconclusive tests, we change our technique.

We decide to see a little more clearly by converting these white strings into hexa.

Hexadecimal of the file

Respecting the line breaks (0x0a), the string is surprisingly square. Moreover, there are only two characters. So it looks like binary. So we replace 0x09 by 0 and 0x20 by 1.

1
2
> sed -i -e "s/09/0/g" scroll_of_truth_hexa
> sed -i -e "s/20/1/g" scroll_of_truth_hexa

Removing the hexa characters from the line break results in a 17*17 square.

Binary version

When you see a perfect square with two possible values, you immediately think of a QRCode. Using this site: https://bahamas10.github.io/binary-to-qrcode/ we get an interesting image:

it’s a datamatrix !

Unfortunately, this is not a QRCode but rather its distant cousin, the Datamatrix.

Now we come to the most complicated part. Indeed, this Datamatrix does not respect the standard format (the size is not even). It cannot be decoded by a scanner or a script found on the internet. It has to be decoded by hand.

After some research, we find clear explanations on how to decode it.

You have to fill the inside of the datamatrix with very precise L-shaped patterns.

decode

and then add the values corresponding to the black cells of each “L” according to this pattern:

calculation

For each pattern, we calculate the sum of the black boxes and we make this number correspond to the hexa decimal code of an ASCII character. We can therefore decode one character per pattern of “L”.

So we return to our Datamatrix and apply the method by filling it with L.

fill

To facilitate the calculation, we superimpose our fill with the squares of our Datamatrix:

superpose

The reading is done in a specific direction as indicated by the arrows.

Flag

H2G2{1_4m_4_b1g_f47_p4nda}

Built with Hugo
Theme Stack designed by Jimmy