https://play.picoctf.org/practice/challenge/116?page=3

Description:

There is something on my shop network running at nc mercury.picoctf.net 59953, but I can’t tell what it is. Can you?

Solution:

So if we run nc mercury.picoctf.net 59953 in the webshell we get a whole bunch of data lines all starting with the letter G. The hint in the challenge asks what code does a CNC machine use? Google tells us that it is called gcode. 

Next we can look for a CNC simulator online and of course there is such a thing:

https://ncviewer.com/

But the webshell doesn’t make it easy to copy all of the lines to the clipboard so we need a way to download the them to our local machine where we can open them in a text editor and clipboard all of the text. So to do this I used the command:

nc mercury.picoctf.net 59953 > gcode.txt

This created a .txt file containing all the data lines. Then I needed to find a way to download this file to my local machine. After searching online for a while and only coming up with complicated answers that didn’t work or needed an install that the picoCTF webshell wouldn’t allow, I went back to basics and read the READme.txt file! In this file we see:

# Experimental features

– Exporting files from the webshell to the browser or vice versa

  is possible using `sz <filename>` / `rz`.

So then it was just a case of: 

sz gcode.txt

Open this file in a text editor, copy all the lines of data to the clipboard and paste in the gcode file field in the NCViewer, hit ‘Plot’ and see the result:

Obviously I’m not going to reveal the answer that would be far too easy for you.