Meshtastic Command & Control

Eric Escobar (Wireless Technical Lead · Sofos)

RF Village @ DEF CON 33 · Day 1 · RF Village

Overview

In this compelling talk at RF Village, Eric Escobar, Wireless Technical Lead at Sofos, introduced Mesh C2, a novel command and control (C2) system built atop the Meshtastic platform. The presentation delved into the intricacies of Meshtastic – an open-source, off-grid, long-range communication solution – and demonstrated how its inherent capabilities can be repurposed for covert red team operations. Escobar, drawing from his extensive experience as a wireless penetration tester, highlighted the critical need for resilient C2 channels in environments where traditional internet or cellular connectivity is unreliable or compromised, particularly for maintaining access to deployed dropboxes.

Watch on YouTube

Visual summary for Meshtastic Command & Control by Eric Escobar
Visual summary for Meshtastic Command & Control by Eric Escobar

Key moments

  1. 0:00 Speaker introduction and Meshtastic overview
  2. 1:20 Meshtastic explained: text messaging walkie-talkies using LoRa
  3. 2:50 Overview of various Meshtastic device types and features
  4. 4:10 Real-world Meshtastic node density and Defcon firmware
  5. 5:30 Technical explanation of LoRa and chirp spread spectrum
  6. 6:10 Meshtastic licensing: ISM band vs. ham radio usage

Meshtastic Command & Control

Speakers: Eric Escobar, Wireless Technical Lead, Sofos

Conference: RF Village

YouTube: https://www.youtube.com/watch?v=-e9V_hlWlVo

Overview

In this compelling talk at RF Village, Eric Escobar, Wireless Technical Lead at Sofos, introduced Mesh C2, a novel command and control (C2) system built atop the Meshtastic platform. The presentation delved into the intricacies of Meshtastic – an open-source, off-grid, long-range communication solution – and demonstrated how its inherent capabilities can be repurposed for covert red team operations. Escobar, drawing from his extensive experience as a wireless penetration tester, highlighted the critical need for resilient C2 channels in environments where traditional internet or cellular connectivity is unreliable or compromised, particularly for maintaining access to deployed dropboxes.

The core innovation of Mesh C2 lies in its ability to transform a standard Meshtastic serial interface into a robust C2 server. This allows operators to send and receive shell commands and debug information to remote devices without relying on conventional infrastructure. By leveraging Meshtastic's encrypted, low-bandwidth, mesh-networking paradigm, Mesh C2 offers a stealthy and persistent communication channel, making it an invaluable tool for adversarial simulations where maintaining a foothold, even with minimal data rates, can dictate the success of an engagement.

Escobar's motivation for developing Mesh C2 stemmed directly from the practical challenges faced by red teams: ensuring that deployed hardware, such as Raspberry Pi-based dropboxes, remains accessible and debuggable even after initial network access is lost. The system’s design prioritizes reliability and operational security, employing strong encryption and intelligent message handling to ensure commands are delivered and responses retrieved, all while operating under the radar of typical network defenses.

Background

▶ Watch: Speaker introduction and Meshtastic overview (0:00)

Meshtastic is an open-source project that transforms inexpensive LoRa (Long Range) radio modules into a robust, off-grid mesh communication network. Conceptually, it functions as a text-messaging walkie-talkie system, enabling users to send short text messages, telemetry data, and GPS coordinates over significant distances without relying on cell towers, Wi-Fi, or the internet. The technology is particularly appealing for its low data rate, exceptional power efficiency, and ability to achieve remarkable ranges, making it ideal for remote areas, emergency communications, or niche technical applications.

The underlying wireless communication protocol, LoRa, utilizes chirp spread spectrum modulation. This technique allows signals to be transmitted below the noise floor, making them highly resistant to interference and enabling long-range communication even with very low power. Meshtastic devices typically operate on unlicensed ISM bands, specifically around 900 MHz in regions like North America, 868 MHz in Europe, and 433 MHz in other areas. This unlicensed operation means users do not require a special license (like a ham radio license) to transmit, and critically, they can use strong encryption, typically AES 256, for their communications. While a "licensed operator" mode exists for ham radio users, enabling higher power and different frequencies, it disables encryption, making it generally unsuitable for covert or private Meshtastic use unless all participants are licensed and agree to unencrypted communication.

Meshtastic supports a variety of hardware, ranging from inexpensive Heltec ESP32-based boards (around $25) that offer basic functionality and Wi-Fi connectivity, to more advanced devices like the Rack Wireless Pocket Mesh (around $150), which boasts integrated GPS, sensors, a screen, and superior power efficiency. For extending network reach in remote areas, solar-powered router nodes are common, designed for "set it and forget it" deployment on high terrain, capable of running for weeks on a single 18650 battery. The speaker himself has deployed such a router on a mountain for over 15 months, emphasizing the importance of robust design and extensive range testing.

Communication within a Meshtastic network is not point-to-point like a traditional walkie-talkie. Instead, messages are routed through a mesh, typically hopping up to three times by default. Each time a message is relayed by a device, its hop count is decremented, preventing packet storms and ensuring efficient routing. Router devices play a crucial role as the backbone of the network, positioned strategically on high ground to maximize line of sight and relay messages across vast distances. Meshtastic offers various communication modes, such as "long fast" (the default, balancing range and speed) and "short turbo" (used by Defcon firmware for high-density, short-range environments), allowing users to optimize for specific scenarios.

Beyond basic text messaging, Meshtastic is highly versatile for telemetry data collection. Devices can integrate with sensors (temperature, humidity, barometric pressure, GPS) and expose GPIO pins for custom sensor input (e.g., sunlight intensity, soil moisture). This makes it suitable for applications like remote weather stations, agricultural monitoring, or tracking assets. The platform also defines various device roles: Client (receives and repeats messages), Client Mute (receives and sends but does not repeat, reducing network congestion), Repeater/Router (prioritized for relaying messages, typically placed high), Tracker (focused on sending GPS telemetry), and Lost and Found (a low-power mode that remains silent until activated by a specific packet, then beacons its location). These roles underscore Meshtastic's adaptability, enabling it to function as a robust and flexible communication layer for a wide array of applications, including those with security implications.

Key Findings

▶ Watch: Overview of various Meshtastic device types and features (2:50)

The central finding and contribution of this talk is the development and demonstration of Mesh C2, a novel command and control framework that leverages the Meshtastic network for off-grid, encrypted, and low-bandwidth communication with remote systems. This tool directly addresses a critical gap in red team operations, particularly the challenge of maintaining persistent access to compromised devices or dropboxes in environments where conventional network connectivity is unreliable or actively monitored.

Mesh C2 effectively repurposes the Meshtastic serial interface, transforming a standard Meshtastic device (like a Heltec board) into a covert C2 agent. This allows red teamers to issue basic shell commands, retrieve output, and debug remote systems even if the primary internet or cellular C2 channel is lost. The system's ability to operate entirely off-grid, leveraging existing Meshtastic mesh infrastructure, significantly enhances operational resilience and stealth.

A key discovery highlighted by Escobar is that Meshtastic router devices, which form the backbone of the network, can relay encrypted messages for private channels without needing access to the encryption key itself. They only process message headers. This means that a Mesh C2 operator can deploy a dropbox in a city, configure it with a unique, encrypted Meshtastic channel, and then leverage the public Meshtastic routers already established in that city to relay their C2 traffic. This capability allows for covert communication through pre-existing, non-attributable infrastructure, drastically reducing the need for the red team to establish their own dedicated RF infrastructure in a target environment.

Furthermore, Mesh C2 incorporates several intelligent design choices to optimize for the low-bandwidth nature of Meshtastic. It automatically chunks large command outputs into multiple, appropriately sized Meshtastic packets and buffers them for sequential retrieval, preventing data loss. It also features message queuing, retries for reliable delivery (defaulting to 3 attempts), and robust AES 256 end-to-end encryption for the C2 channel. These features collectively enable Mesh C2 to serve as a reliable, albeit low-speed, lifeline for red team assets, ensuring that critical debugging, status checks, and basic command execution remain possible even under challenging conditions.

Technical Deep Dive

▶ Watch: Real-world Meshtastic node density and Defcon firmware (4:10)

Mesh C2 is designed as a lightweight, persistent daemon that runs on a Linux host, typically a Raspberry Pi or similar single-board computer, connected to a Meshtastic device via its serial interface. The primary function of Mesh C2 is to translate standard shell commands into Meshtastic messages, transmit them over a dedicated encrypted channel, and then receive and process the output of those commands, presenting them back to the operator.

Upon installation, Mesh C2 automatically generates a unique AES 256 symmetric encryption key for its dedicated Meshtastic channel. This ensures that all command and control traffic is end-to-end encrypted, preventing eavesdropping by unauthorized parties, even if they are monitoring the Meshtastic network. The speaker emphasized the importance of this encryption, recounting a development anecdote where an accidental public broadcast of the C2 server's availability on an open channel was quickly noticed by other mesh users, underscoring the necessity of secure channel separation.

The operational flow for Mesh C2 is as follows:

  1. Command Issuance: An operator interacts with the Mesh C2 daemon, typically by echoing commands into a designated input, which can be integrated into bash scripts or custom tools. For example, echo "ls -la" | mesh_c2_send_command.
  2. Message Formatting: The daemon formats the command into a Meshtastic message, encrypts it using the channel's AES 256 key, and sends it to the connected Meshtastic device via serial.
  3. Network Transmission: The Meshtastic device broadcasts the encrypted message. Crucially, if the message is destined for a remote target, it can be relayed by any Meshtastic router nodes in the network. These routers do not need to possess the encryption key; they only process the unencrypted message headers (e.g., destination, hop count) to forward the packet. This allows Mesh C2 to leverage existing public mesh infrastructure without compromising the confidentiality of the C2 traffic.
  4. Target Execution: The target Meshtastic device, also running a Mesh C2 daemon configured with the same encryption key, receives the message. It decrypts the command, executes it on the host system, and captures the standard output and error.
  5. Output Transmission: The command output is then formatted into Meshtastic messages, encrypted, and sent back to the operator. A critical feature here is message chunking: if the output is too large for a single Meshtastic packet (which has a very limited payload size), Mesh C2 automatically breaks it into multiple, appropriately sized chunks.
  6. Buffering and Pagination: On the operator's side, Mesh C2 receives these output chunks and stores them in a buffer for approximately 5 minutes. This allows the operator to request more of the output using a "more" command, effectively paginating large results without overwhelming the low-bandwidth channel. This intelligent buffering prevents data loss and allows for methodical review of command output.
  7. Reliability Features: To enhance reliability, Mesh C2 incorporates several features:
  • Retries: By default, it attempts to send each message three times, awaiting an acknowledgment from the recipient. This is particularly useful for small, low-power devices with less robust antennas.
  • Queuing: Multiple incoming alerts or outgoing commands are queued and processed sequentially, preventing collisions and ensuring orderly communication.
  • Optional Timestamps: Operators can choose to append timestamps to messages, providing context on when commands were executed or data received, though this consumes precious payload space.

The system is configured as a systemd service for persistent operation on Linux hosts. While all commands and their outputs are logged by default on the device for auditing purposes, this feature can be disabled if operational security requires minimizing forensic artifacts on a compromised dropbox. Beyond C2, Mesh C2 also provides utility functions for Meshtastic device management, such as creating and listing channels, and backing up/restoring configurations, all from the terminal. The speaker also mentioned a "non-real device mode" for simulation or development without physical hardware.

The tool is intentionally designed for low-bandwidth tasks, such as restarting a network service, checking interface configurations (ifconfig), or verifying device uptime (uptime). It is explicitly not designed for high-bandwidth operations like running Metasploit modules, large data exfiltration, or streaming data, which would overwhelm the Meshtastic network's capabilities. However, for obtaining critical debug information or maintaining a basic heartbeat, Mesh C2 proves to be an exceptionally robust and stealthy solution.

Demo / Proof of Concept

▶ Watch: Technical explanation of LoRa and chirp spread spectrum (5:30)

While the talk did not feature a live, interactive demonstration of Mesh C2 being operated against a remote target in real-time, Eric Escobar effectively conveyed its functionality and capabilities through conceptual walkthroughs, architectural diagrams, and screenshots of command outputs. The primary proof of concept revolved around demonstrating the system's ability to execute shell commands and handle their output over the Meshtastic network.

Escobar illustrated a scenario where a simple ls command was issued to a remote Mesh C2 agent. The screenshot presented during the talk showed the command being received by the agent, acknowledged, and then its output (potentially a long list of files) being returned to the operator. This output was clearly segmented into multiple Meshtastic messages, demonstrating the chunking and buffering mechanisms in action. The operator could then use a "more" command to paginate through the buffered output, retrieving successive chunks of data as needed. This highlights Mesh C2's intelligent handling of the low-bandwidth constraints inherent to Meshtastic, ensuring that even verbose command outputs can be retrieved reliably.

A key practical proof of concept discussed was the red team dropbox scenario. Escobar detailed how Mesh C2 was developed out of necessity for maintaining access to physical dropboxes (e.g., a Raspberry Pi disguised inside a rat trap) deployed covertly within a target's physical environment. The Meshtastic device attached to the dropbox would provide an out-of-band C2 channel. If the primary internet or cellular connection to the dropbox failed (e.g., due to port security, network segmentation, or a reboot), the red team could use Mesh C2 to send commands to debug the issue, restart services, or re-establish the primary C2, all without needing to physically re-access the dropbox. This demonstrates the tool's utility as a resilient backup C2 channel.

Furthermore, Escobar explicitly mentioned using Mesh C2 in the Wireless CTF (Capture The Flag) challenges at Defcon. Here, it served as a mechanism for transmitting flags for certain Meshtastic-related challenges. This real-world application in a competitive hacking environment underscores its practical viability and the unique capabilities it offers for covert data transmission.

Finally, in response to an audience question, Escobar confirmed the potential for Mesh C2 to integrate with other hardware implants like OMG cables or keyloggers. While Mesh C2 is not designed for high-volume data exfiltration, it could be used as a low-bandwidth backhaul. For instance, a dropbox could collect data from an OMG cable (e.g., keystrokes, network traffic snippets) or a keylogger, and then use Mesh C2 to securely transmit small batches of this sensitive text-based data over the Meshtastic network, providing a stealthy exfiltration vector bypassing traditional network defenses. This illustrates its versatility beyond just remote debugging and command execution.

Defensive Implications

▶ Watch: Meshtastic licensing: ISM band vs. ham radio usage (6:10)

The existence and functionality of Mesh C2 present several unique challenges and considerations for defensive security teams, particularly those concerned with physical security, insider threats, and advanced persistent threats (APTs) employing novel C2 channels.

  1. Physical Security Reinforcement: Mesh C2 primarily targets physical access scenarios where dropboxes are deployed. Defenders must reinforce physical security measures, including access controls, surveillance, and regular inspections of sensitive areas. The "rat trap" dropbox example highlights the creativity of adversaries in camouflaging devices; therefore, security teams should conduct thorough sweeps for unusual or disguised hardware.
  2. RF Monitoring and Anomaly Detection: While Meshtastic operates on unlicensed ISM bands and uses low power, the presence of unusual or sustained LoRa traffic within a facility could be an indicator of compromise. Traditional RF monitoring solutions might struggle to detect these low-power, chirp spread spectrum signals, but specialized RF analysis tools could potentially identify patterns inconsistent with legitimate usage. However, the end-to-end encryption of Mesh C2 traffic means that even if detected, the content would remain unreadable without the shared AES 256 key.
  3. Understanding Meshtastic Infrastructure: Defenders should be aware that public Meshtastic routers, deployed by enthusiasts, can inadvertently serve as relay points for encrypted adversarial C2 traffic. This means that an organization does not need to have Meshtastic devices deployed within its perimeter for its infrastructure to be leveraged by an attacker. The widespread and decentralized nature of Meshtastic networks makes them a difficult vector to fully mitigate from a network-centric perspective.
  4. Supply Chain and Device Integrity: For organizations that do utilize Meshtastic devices for legitimate purposes (e.g., remote telemetry, IoT), ensuring the integrity of firmware and device configurations is paramount. Adversaries could potentially compromise these devices to establish their own C2 channels or use them as stepping stones within the mesh. Regular auditing of device roles (e.g., ensuring client mute is enabled for personal devices that don't need to repeat) and monitoring for unauthorized channel configurations are important.
  5. Data Exfiltration Awareness: Although Meshtastic is low-bandwidth, Mesh C2 demonstrates its capability for small-scale data exfiltration, such as passwords, hashes, or keylogger data. Defenders should consider the potential for these "trickle" exfiltration methods that bypass conventional data loss prevention (DLP) systems.
  6. Insider Threat Considerations: An insider with physical access could easily deploy a Meshtastic-enabled dropbox or even use a personal Meshtastic device to facilitate C2 for other implants, leveraging the off-grid nature of the communication to bypass network monitoring.
  7. Training and Awareness: Security teams, especially physical security and incident response personnel, should be educated on Meshtastic technology, its potential for covert operations, and the types of devices involved. This awareness can aid in identifying suspicious hardware or RF activity.

In essence, Mesh C2 highlights the evolving landscape of C2 channels, moving beyond traditional network protocols to embrace novel wireless technologies. Defenders must expand their threat models to include these off-grid and low-power communication methods, focusing on physical security, RF awareness, and understanding the broader ecosystem of decentralized communication networks.

Key Takeaways

  • Off-Grid, Encrypted C2: Mesh C2 provides a unique, off-grid, and end-to-end encrypted command and control channel leveraging the Meshtastic LoRa network, ideal for environments lacking traditional internet or cellular connectivity.
  • Red Team Resilience: It serves as a critical lifeline for red team operations, enabling remote debugging, status checks, and basic command execution on deployed dropboxes even after primary C2 channels are lost.
  • Leveraging Public Infrastructure: Mesh C2 can utilize existing public Meshtastic router networks to relay encrypted C2 traffic without needing the routers to possess the encryption key, enhancing stealth and reach.
  • Low-Bandwidth Optimization: The tool is engineered for Meshtastic's low-bandwidth nature, featuring intelligent message chunking, buffering, queuing, and retries for reliable command delivery and output retrieval.
  • Defensive Challenge: Defenders face challenges in detecting Meshtastic-based C2 due to its low power, unlicensed spectrum use, and encryption, necessitating increased focus on physical security and specialized RF monitoring.
  • Versatile Application: Beyond C2, Meshtastic's capabilities extend to remote telemetry, asset tracking, and emergency communications, underscoring its broad utility in various technical and security contexts.

About the Speaker(s)

Eric Escobar is the Wireless Technical Lead at Sofos, a role he transitioned into after previously working at SecureWorks. In his day job, he operates as a wireless penetration tester and adversarial operator, focusing on hacking and breaking into various systems and networks. This hands-on experience in red teaming directly informed the development of Mesh C2, which he created out of a practical necessity to solve real-world problems encountered during his engagements. Escobar is a passionate advocate for Meshtastic technology, owning a comprehensive collection of devices and having extensively tested them since their inception. His deep technical understanding and practical experience in both offensive security and wireless communications make him a credible voice in the field.

Reviews

Dr. Zero (Offensive Security Researcher) — STRONG ACCEPT

Escobar brings a genuinely useful red team tool to the table — a LoRa-based C2 channel that leverages public Meshtastic mesh infrastructure to maintain out-of-band access to deployed implants. This is practitioner-built tooling solving a real operational problem, and the insight that public routers relay encrypted payloads without holding the key is the kind of quiet detail that makes defenders uncomfortable in exactly the right way.

Heather Calloway (CISO) — WEAK

Technically credible red team tooling with a real operational use case, but this talk lives entirely inside the offensive operator's world. The defensive section is a list, not an analysis, and no one responsible for a security program leaves knowing what to change.

→ Top-rated talks at RF Village @ DEF CON 33

All talks from RF Village @ DEF CON 33