Lets Warm Up – picoCTF 2019

Challenge

If I told you a word started with 0x70 in hexadecimal, what would it start with in ASCII?

Hint

Submit your answer in our competition’s flag format. For example, if you answer was ‘hello’, you would submit ‘picoCTF{hello}’ as the flag.

Solution

There are many ways to solve this, so I will go through 3 ways of doing it, in increasing difficulty. The different methods will help later when we want to quickly translate hex to ASCII or vice versa, rather than sticking to one method.

Method 1: Online Converter

RapidTables is a good site for hex specifically. It quickly converts, with the option to change encoding.

Decoding the hex can also be done manually with an ASCII table like the following found on asciitable

Notice that where the hex equals 70 in its column, the ASCII value is ‘p’.

Method 2: Python

This method is great when you’re already working in Python or you are in a CLI environment. Python has an easy way of converting hex to ASCII, but keep in mind Python2 and Python3 have different methods.

python3: bytes.fromhex(‘hexvalue’). Ignore the “b” as that comes from the bytes.

In Python2, it is simply .decode(‘hexvalue’) instead, as shown below in a Linux environment:

Method 3: Bash

The final method is less convenient than python (if you’re already working within it’s environment), but if you’re working in a shell where python is not installed, you can run the following command:

Flag

The flag, in the pico format, is picoCTF{p}



Previous: The Factory’s SecretNext: Warmed Up