picoCTF General Skills Guide

here's how to solve Glitch Cat

Back to the General Skills Guides

Glitch Cat

Name: Glitch Cat
Description: Our flag printing service has started glitching! $ nc saturn.picoctf.net 51392
Author: LT 'syreal' Jones
Tags: Easy, General Skills, Beginner picoMini 2022, nc, shell, Python
Challenge from: Beginner picoMini 2022
Hints:
1. ASCII is one of the most common encodings used in programming
2. We know that the glitch output is valid Python, somehow!
3. Press Ctrl and c on your keyboard to close your connection and return to the command prompt.

Theory

According to the description, to get the flag we'll need to fix some code or something, since they've told us the flag printing program isn't working correctly.

Solution

We just need to enter the NetCat, and see what's going on:

shukularuni-picoctf@webshell:~$ nc saturn.picoctf.net 51392
'picoCTF{gl17ch_m3_n07_' + chr(0x61) + chr(0x34) + chr(0x33) + chr(0x39) + chr(0x32) + chr(0x64) + chr(0x32) + chr(0x65) + '}'

So it seems that instead of printing the actual flag, it's printing the character command for each character in that part of the flag, so we can just run that on a python print, and should get the correct flag:

print('picoCTF{gl17ch_m3_n07_' + chr(0x61) + chr(0x34) + chr(0x33) + chr(0x39) + chr(0x32) + chr(0x64) + chr(0x32) + chr(0x65) + '}')

picoCTF{gl17ch_m3_n07_a4392d2e}

There we go! That's the flag.

I rated this level as "good"! :3


https://play.picoctf.org/practice/challenge/242