PicoCTF - speeds and feeds | IAANSEC

Description

Firstly, I start off by netcatting to the server and write the output of the response to a text file. Below is the response from the server:

G17 G21 G40 G90 G64 P0.003 F50
G0Z0.1
G0Z0.1
G0X0.8276Y3.8621
G1Z0.1
G1X0.8276Y-1.9310
G0Z0.1
...

Right off the bat, I have no clue what I am looking at… So I take the first line of the code and Google it. The first result I get is a document for “G-Codes


What is G-Code?

G-Code, or G programming language, is a set of instructions used to control computerized machine tools and 3D printers or CNCs (Computer Numerical Control). The “G” stands for “geometric,” and the code generally consists of alphanumeric characters that represent specific commands for the machine. G-Code is essential in the manufacturing process, as it guides the machine’s movements and operations.

Here are some common elements found in G-Code:

G-Code is used in computer-aided manufacturing (CAM) to convert design drawings or models into actual physical parts. Programmers generate G-Code using CAM software, which interprets the design and outputs a sequence of G and M codes. The machine tool then follows these instructions to shape the raw material into the desired product.

It’s important to note that G-Code can vary slightly between different CNC (Computer Numerical Control) machines and manufacturers, but the fundamental principles remain consistent. Understanding G-Code is crucial for CNC machine operators, programmers, and anyone involved in computerized manufacturing processes.

I won’t be going into depth of how to read G-code as there are many articles and blogs already covering this topic for those who are interested here are a few resources:


Capturing the Flag

After identifying the code is G-Code I then Google an interpreter for G-Code, and came across NCViewer. I upload the output text file containing the G-Code, click the Play button, and end up with this…

https://youtu.be/KNjYV4Z4DDM

Connect With Me!

Website Website Website Website