Mysterious

Category

Rev

Description

Find the input.

Solution

Attached to the challenge is the following text file.

>~~~~~~~~~~~~~7-055+p95+-119+p94867++++-274+1-p778351137+++++++++v
                                    v194--1-4-8-6+++3539p-2+393  <
v16++74p+555+++++++++++99485271536p+<
>9+pv
    >41-92++-745+3-4+p72-888++-7591+++++8924++5-p555541-++++v
v                                                           <
>+45+7724+++5-5-p79+45+-52+-+3115+++67+3-p66+-114++7+2-4442-++pv

                     @p-1+56+++++++++++111111111111-+++++567734<

v+L^0k@%~~a`F

After some research we find out that it’s Befunge code.

By using the this interpreter we can load and run the code.

Code in interpreter

From this we find out that the program is expecting 13 characters as input, and when executed, the last part in the code changes when calculations are made.

If we enter flag{1234567} as input we can see that when the known parts of the flag is calculated, the memory part of the code is unchanged. So we can set a breakpoint right before each p operation in the code to find out what our input vs the expected result should be, and by that calculating the correct value for each character in the flag.

flag{35014n9}

n00bz

Home of the n00bz CTF team.


By n00bz, 2022-02-20