Level09

Obfuscated token

when we login as level08 user we are given 2 files :

level09@SnowCrash:~$ ls -l
total 12
-rwsr-sr-x 1 flag09 level09 7640 Mar  5  2016 level09
----r--r-- 1 flag09 level09   26 Mar  5  2016 token

Here we can read the file token and we can see :

level09@SnowCrash:~$ cat token 
f4kmm6p|=�p�n��DB�Du{��

We alse have a binary file called level09 when we execute it we get :

level09@SnowCrash:~$ ./level09 
You need to provied only one arg.

It expect an argument, so when we provide an argument where is what we get :

level09@SnowCrash:~$ ./level09 token 
tpmhr
level09@SnowCrash:~$ ./level09 ""

level09@SnowCrash:~$ ./level09 "123456789"
13579;=?A
level09@SnowCrash:~$ ./level09 "abcdefgh"
acegikmo
level09@SnowCrash:~$ ./level09 "1234567890abcdefghijklmnopqrstuvwxyz"
13579;=?A9kmoqsuwy{}���������������

when we provided the argument 123456789 we got 13579;=?A and when we provided abcdefgh we got acegikmo Just by looking at it we can see that each character is the result of the character code + the position.

So for abcdefgh we will have :

From here we can guess that it is possible that the data in the file token might have been encoded using this technique.

To decode the data all we have to do is just remove the value of position from the value in question.

So if we have have the following Ascii code (in the following order) 97 99 101 (which is a c e) all we have to do to get it's original valie is 97 - 0 99 - 1 101 - 2 and we will get the decoded value (which is a b c)

Here is a simple program that can decode any value encoded using the above technique :

If we can use the above progran as following :

For me the following command did not work to compile the file decode.c located in /tmp/ directory :

To solve the problem i changed the current directory to /tmp/ and then compiled :

Password for next level

So the Password to connect to the account level10 is s5cAJpM8ev6XHw998pRWG728z

Command summery

Alternative method

If you do decide to decompile the level09 binary here is what you will get. I have cleaned the data to make it more readable :

The binary level09 was disassembled using retdec

Last updated

Was this helpful?