Introduction:
In level 09, we are provided with a token encoded as a list of hexadecimal values. Our objective is to decode this token using a Python script.
Steps:
Understanding the Token Encoding:
We have a token represented as a list of hexadecimal values:1
2
3data = [0x66, 0x34, 0x6b, 0x6d, 0x6d, 0x36, 0x70, 0x7c, 0x3d, 0x82, 0x7f, 0x70,
0x82, 0x6e, 0x83, 0x82, 0x44, 0x42, 0x83, 0x44, 0x75, 0x7b, 0x7f, 0x8c,
0x89]Each value in the list corresponds to a ASCII character in the buffer.
Decoding the Token:
We use a Python script to decode the token by subtracting the index from each characterโs ASCII value:1
2flag = "".join([chr(data[i] - i) for i in range(len(data))])
print(flag)This script will output the decoded flag.
Executing the Script:
We save the script in a file, letโs saydecode_flag.py
, and then execute it or just run the following command:1
2
3python3 -c 'data = [0x66, 0x34, 0x6b, 0x6d, 0x6d, 0x36, 0x70, 0x7c, 0x3d, 0x82, 0x7f, 0x70,
0x82, 0x6e, 0x83, 0x82, 0x44, 0x42, 0x83, 0x44, 0x75, 0x7b, 0x7f, 0x8c,
0x89];flag = "".join([ chr(data[i] - i) for i in range(len(data)) ]);print(flag)
Conclusion
By decoding the token using the provided Python script, we successfully obtained the flag for level 09.