hardwarefreemedium

Critical Flight

hackthebox

Task: Analyze Gerber PCB manufacturing files for irregularities in a drone flight controller. Solution: Visualize inner copper layers to find hidden flag text drawn with copper traces.

$ ls tags/ techniques/
hidden_data_extractiongerber_analysispcb_layer_visualization

$ cat /etc/rate-limit

Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.

Critical Flight — HackTheBox

Description

Your team has assigned you to a mission to investigate the production files of Printed Circuit Boards for irregularities. This is in response to the deployment of nonfunctional DIY drones that keep falling out of the sky. The team had used a slightly modified version of an open-source flight controller in order to save time, but it appears that someone had sabotaged the design before production. Can you help identify any suspicious alterations made to the boards?

Analysis

The task provides an archive with Gerber files — a standard format for PCB (Printed Circuit Board) manufacturing. The files describe the "HadesMicro" board — a flight controller for drones.

File Structure

HadesMicro-F_Cu.gbr    - Front Copper layer
HadesMicro-B_Cu.gbr    - Back Copper layer
HadesMicro-In1_Cu.gbr  - Inner Copper layer 1
HadesMicro-In2_Cu.gbr  - Inner Copper layer 2
HadesMicro-F_Silkscreen.gbr - Silkscreen markings
HadesMicro-F_Mask.gbr  - Solder mask
HadesMicro-Edge_Cuts.gbr - Board outline

Gerber Format

Gerber is a text format with coordinates and D-codes:

  • D01 — draw
  • D02 — move without drawing
  • D03 — flash/point

Coordinates are specified in the format X...Y...D...*

Key Observation

Multi-layer PCBs have inner copper layers that:

  1. Are invisible on the finished board
  2. Are present in manufacturing files
  3. Are an ideal place for hiding data

Solution

Step 1: Parsing Gerber Files

Wrote a Python script to extract coordinates from Gerber:

#!/usr/bin/env python3 """ Gerber file parser and visualizer for PCB analysis. Extracts coordinates and renders copper layers. """ import re import matplotlib.pyplot as plt from pathlib import Path ...

$ grep --similar

Similar writeups