PicoCTF Writeup – Glitch Cat

# Information:

CTF Name: PicoCTF

CTF Challenge:  Glitch Cat

Challenge Category: General Skills

Challenge Points: 100

Beginner picoMini 2022.

# Challenge Description:

Our flag printing service has started glitching!

$ nc saturn.picoctf.net 65353

Hints:

Hint 1
ASCII is one of the most common encodings used in programming

Hint 2
We know that the glitch output is valid Python, somehow!

Hint 3
Press Ctrl and c on your keyboard to close your connection and return to the command prompt.

# Writeup:

Hello, and welcome to another picoCTF challenge write-up. This challenge is interesting to help us learn how to write a small python script.

Step 1:

First, I ran the command:

$ nc saturn.picoctf.net 65353

Below you have the output:

From experience, I know that 0x39 represents an hexadecimal character. And also, the chr function is Python 3 syntax. This function, simply “Return the string representing a character whose Unicode code point is the integer i” (soruce). In our case, we have 0x before the integer (indicating hexadecimal), therefore, it will convert from hexadecimal representation into the respective ASCII character. Example:

0x39 = ‘9’

0x63 = ‘c’

Therefore, to solve this challenge we have to create a simple Python 3 script (or simply use the Python 3 console):

1
2
flag_missing_part = chr(0x39) + chr(0x63) + chr(0x34) + chr(0x32) + chr(0x61) + chr(0x34) + chr(0x35) + chr(0x64)
print("picoCTF{gl17ch_m3_n07_" + flag_missing_part + "}")

To better understand the conversion, you can also try to do this manually by using an ASCII table.

But I am lazy, so I will use the script:

I got the flag.

The flag is:

Show flag
picoCTF{gl17ch_m3_n07_9c42a45d}


Thank you very much for reading!

Cheers,

MRegra


Leave a Reply

Your email address will not be published. Required fields are marked *