=

Binhexa writeup - Pico CTF ( General skills )

Description : How well can you perfom basic binary operations?

Solution -

Step 1: Start the instance - First, start the instance and connect to the host using given command in descriptioin after starting the instance.

After connecting to the host you will get 2 binary values, and a operator to perform an binary operation.There ould be 6 operators one by one. In my case values were :

  • Binary Number 1: 00010111 (23 in decimal)
  • Binary Number 2: 00100101 (37 in decimal)

Step 2: Operation 1/6 - Binary Addition (+) : The first operation is binary addition. To add two binary numbers, align them and add bit by bit. The result of adding 00010111 and 00100101 is 0111100 (60 in decimal).

binhexa pico ctf solution binary addition image

Step 3: Operation 2/6 - Right Shift (>>) : Next, we perform a right shift operation on Binary Number 2. Right shifting moves all bits to the right by the specified number of positions, and zeros are added to the left. In this case, the right shift by 1 gives: 00010010 (18 in decimal)

binhexa pico ctf solution right shift image

Step 4: Operation 3/6 - Bitwise AND (&) : The third operation is the bitwise AND, which compares each bit of the two numbers and returns 1 only if both bits are 1. The result of 00010111 & 00100101 is: 00000101 (5 in decimal)

binhexa pico ctf solution binary and image

Step 5: Operation 4/6 - Bitwise OR (|) : The fourth operation is the bitwise OR, which compares each bit of the two numbers and returns 1 if either bit is 1. The result of 00010111 | 00100101 is: 00110111 (55 in decimal)

binhexa pico ctf solution binary or image

Step 6: Operation 5/6 - Binary Multiplication (*) : The fifth operation is binary multiplication. Multiplying 00010111 and 00100101 yields: 01101010011 (851 in decimal)

binhexa pico ctf solution binary multiplication image

Step 7: Operation 6/6 - Left Shift (<<) : The sixth operation is a left shift of Binary Number 1. Left shifting moves all bits to the left by the specified number of positions, and zeros are added to the right. In this case, a left shift by 1 gives: 00101110 (46 in decimal)

binhexa pico ctf solution binary left shift image

Step 8: Hexadecimal Conversion : The final step asks for the hexadecimal equivalent of the last result from the left shift operation. In this case, we need to convert 00101110 (46 in decimal) into hexadecimal. The result is: 2e

binhexa pico ctf solution hex conversion image

After submitting the hexadecimal value 2E, the server will provide you with the flag!


Flag is - picoCTF{b1tw^3se_0p3eR@tI0n_su33essFuL_aeaf4b09}