PicoCTF Writeup – Nice netcat

# Information:

CTF Name: PicoCTF

CTF Challenge: Nice netcat

Challenge Category: General Skills

Challenge Points: 15

picoCTF 2021.

# Used Tools:

  • Linux
  • ASCII Decoder

# Challenge Description:

There is a nice program that you can talk to by using this command in a shell: $ nc mercury.picoctf.net 21135, but it doesn’t speak English…

Hints:

Hint 1
You can practice using netcat with this picoGym problem: what’s a netcat?
Hint 2
You can practice reading and writing ASCII with this picoGym problem: Let’s Warm Up

# Writeup:

Hello, and welcome to another picoCTF challenge write-up.

Step 1:

Upon reading the Description of this picoCTF challenge, we copied the command (found in the Description) and pasted it into our shell. And we were presented with the information in the image below:

After seeing what was printed, we thought that this could be ASCII¹ (We thought it could be ASCII because we encountered similar challenges in the past. No magic, just past experience), and that was what we tried.

Step 2:

So, there are two ways to solve this problem, which are:

  • Search for an ASCII decoder or
  • Make our decoder. Guess what did we do? Because we are lazy… We made our ASCII decoder, and you can get it down below.
with open("out.txt") as f:
    lines = f.readlines()
    for line in lines:
        print(chr(int(line.split()[0])), end="")

If you want to use our code you will need to do some extra steps that are:

  • you need to create a file .txt
  • replace the “out.txt” in the code above with “the_name_that_you_gave_to_your_file.txt” And that is it.

However, you can use, from the internet, a platform to decode your ASCII code. You have, for instance, this one: https://checkserp.com/encode/ascii/

Once we ran the decoder we got the flag.

The flag is:

Show flag
picoCTF{g00d_k1tty!_n1c3_k1tty!_afd5fda4}

Footnotes:

¹The ASCII stands for American Standard Code for Information Interchange. You can see in the image below that graphical characters are represented by numbers.

Note: Below you have an ASCII table, if you want to do this manually.


Thank you very much for reading!

Cheers,

SoBatista


Leave a Reply

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