Endianness writeup - Pico CTF ( General skills )
Solution -
Step 1: Launch the instance - Upon launching the challenge, you receive a netcat (nc) command that connects you to the remote host. The command will look something like this: nc titan.picoctf.net 64607
Run the command to connect. Once connected, the server will provide you with a word and ask for the little endian version of it.
Step 2: Convert the Word into Hex - The word you receive from the server must first be converted into hexadecimal format. This can easily be done using the xxd command in Linux or macOS:
echo -n "rjgzr" | xxd -p
This will output the hex value in big endian format. For example, the output might look like this: 726a677a72
Step 3: Convert Big Endian to Little Endian - Now, we need to reverse the order of the hex pairs to convert it from big endian to little endian. In this example:
- Big endian: 72 6a 67 7a 72
- Little endian: 72 7a 67 6a 72
So, the little endian version would be 727a676a72
Step 4: Enter Little Endian Version Once you have the little endian hex value, return to the netcat session and input the result. The server will then ask you to provide the big endian version of the word, which you already have from step 2.
After providing both the little endian and big endian versions, the server will give you the flag.
Flag is - picoCTF{3ndi4n_sw4p_su33ess_817b7cfe}