Challenge

This challenge looks at analysing basic java code in order to create the flag without running the code. You can access it by going here (will require logging in…)

The java code can be accessed here.

Solution

We can recreate the challenge by using the array listing in the java source file in a programming language of choice. I have decided to use python for this example:

password = [''] * 32 # Create a list of 32 characters that represents the length of the flag 

password[0]  = 'd'
password[29] = 'a'
password[4] = 'r'
password[2]  = '5'
password[23] = 'r'
password[3] = 'c'
password[17] = '4'
password[1]  = '3'
password[7]  = 'b'
password[10] = '_'
password[5]  = '4'
password[9]  = '3'
password[11] = 't'
password[15] = 'c'
password[8]  = 'l'
password[12] = 'H'
password[20] = 'c'
password[14] = '_'
password[6]  = 'm'
password[24] = '5'
password[18] = 'r'
password[13] = '3'
password[19] = '4'
password[21] = 'T'
password[16] = 'H'
password[27] = '6'
password[30] = 'f'
password[25] = '_'
password[22] = '3'
password[28] = 'd'
password[26] = 'f'
password[31] = '4'

print("picoCTF{{{0}}}".format(''.join(password)))