HACKDAY Qualif 2023

Astronaut's Poem [342 pts]

 Challenge Description

Challenge Description:

Link to challenges

## Challenge Description

Photo

This is an Stegnography Challenge, in which we are given a pdf containing 1 page of poem only. We are asked to find the constellation in French and in lower case of the constellation containing the found NGC.

## Solution

We start with the metadata of the pdf file.

exiftool Astronauts_Poem.pdf

We will notice this line: Language : https://esolangs.org/wiki/Poetic

Poetic is an esoteric programming language created by User:JWinslow23 in 2018. It is a derivative of brainfuck that encodes instructions into the lengths of words. Programs generally look like abstract poetry, and upon execution, they are turned into a list of numbers denoting the lengths of the words, and then executed as instructions.

And there exists an Official online interpreter. After executing the poem we receive:

Photo

We return to our poem and search for the line 10. Remember that we need to find a number representing a NGC, so we should try execute the line 10 ourselves. According to the official site of Poetic language, we have:

Value Brainfuck Equivalent Description
1 [ If the current byte is equal to 0, jump execution to after the matching 2.
2 ] If the current byte is not equal to 0, jump execution to the matching 1.
3 + Increment the value of the current byte by next_digit. If next_digit is 0, the value used instead is 10.
4 - Decrement the value of the current byte by next_digit. If next_digit is 0, the value used instead is 10.
5 > Increment the memory pointer by next_digit. If next_digit is 0, the value used instead is 10.
6 < Decrement the memory pointer by next_digit. If next_digit is 0, the value used instead is 10.
7 . Output the value of the current byte as an ASCII character.
8 , Read a character from the input stream, and write its ASCII value to the current byte. (Note: This fails to update the current byte upon end of input.)
9 N/A Set the current byte to a random value from 0 to 255.
0 N/A End program execution here. This does not end program execution if it is used as an argument for 3, 4, 5, or 6.

And the number is derived from the word following these rules:

Applying these to line 10, we obtain this:

5 2 3 9 1 5 2 3 10 3 10 3 10 6 2 4 1 2 5 2 0

5239 : move the memory_pointer and + 9

152310310310 : start a loop in which we add 10 three times and get back to the position of the 9

the rest is to break out of loop and end. So basically we have 9 * (10 + 10 + 10) = 270.

After this we receive the number 270, and the NGC 270 is in the constellation Cetus, or la constellation de la Baleine in French. So the flag is HACKDAY{baleine}.