How we ran an online hardware CTF
Thomas Hobson (Computer Engineering Student · University of Canterbury), Emily Trau, Tom Nguyen (Software Engineer)
BSides Canberra VII (2024) · Day 2 · Main Track
Overview
This talk, presented at BSides Canberra by Thomas Hobson, Emily Trau, and Tom Nguyen, details the ambitious undertaking of creating and operating a novel online hardware Capture The Flag (CTF) competition. The team, representing Down Under CTF, sought to introduce a new class of challenges that allowed over 4,000 players globally to interact with real circuits and perform hardware security attacks, bypassing the inherent limitations of simulation. This initiative aimed to democratize access to hardware security experimentation, providing a crucial learning opportunity for participants who might otherwise lack the specialized tools and equipment.

Key moments
- 0:00 Introduction: Running an online Hardware CTF
- 4:00 Why the RP2040 (Pico) was the perfect chip
- 5:00 Overall hardware system topology and challenge cards
- 11:00 Sandboxing untrusted code on the hardware
- 14:00 Examples of implemented hardware CTF challenges
- 18:00 The Eevee cloud platform and microservices architecture
- 21:00 Detailed workflow for challenge submission and execution
- 24:00 Q&A: Most unexpected challenges during development
How we ran an online hardware CTF
Speakers: Thomas Hobson (Computer Engineering Student, University of Canterbury); Emily Trau; Tom Nguyen (Software Engineer)
Conference: BSides Canberra
YouTube: https://www.youtube.com/watch?v=FT-ase5BuBU
Overview
This talk, presented at BSides Canberra by Thomas Hobson, Emily Trau, and Tom Nguyen, details the ambitious undertaking of creating and operating a novel online hardware Capture The Flag (CTF) competition. The team, representing Down Under CTF, sought to introduce a new class of challenges that allowed over 4,000 players globally to interact with real circuits and perform hardware security attacks, bypassing the inherent limitations of simulation. This initiative aimed to democratize access to hardware security experimentation, providing a crucial learning opportunity for participants who might otherwise lack the specialized tools and equipment.
The core of their innovation lay in designing a completely custom hardware and software stack capable of securely hosting untrusted user code on physical microcontrollers. This platform enabled players to upload arbitrary code for execution, granting them complete control over their virtual hardware lab while rigorously maintaining the security, isolation, and safety of the underlying infrastructure. The talk delves into the meticulous selection of the RP2040 microcontroller, the modular hardware architecture, the robust sandboxing mechanisms, and the sophisticated cloud infrastructure (Eevee) that made this large-scale, authentic hardware CTF possible.
The significance of this project extends beyond just a competition; it represents a significant step forward in hardware security education. By providing a low-barrier-to-entry environment for hands-on hardware exploitation, the Down Under CTF team has empowered a broad audience to engage with complex topics like side-channel analysis, fault injection, and embedded system vulnerabilities in a practical, real-world context. The insights shared offer valuable lessons for anyone interested in building secure, scalable platforms for hardware interaction or understanding the practical implications of embedded system security.
Background
▶ Watch: Introduction: Running an online Hardware CTF (0:00)
The Down Under CTF (DCTF) had, for its fifth iteration, a clear vision: to expand beyond traditional web, reverse engineering, and binary exploitation challenges by introducing a dedicated hardware category. This ambition was driven by the recognition that hardware security, while critical, often remains inaccessible to many aspiring cybersecurity professionals and hobbyists. The high cost of specialized equipment, the complexity of development environments, and the physical constraints of setting up lab spaces often deter individuals from exploring this vital domain.
To overcome these barriers, the team committed to building a platform that would allow participants to interact with real circuits, moving beyond mere software simulations. The goal was to create an authentic experience for modeling threats and attacks, giving users the ability to upload arbitrary code for execution directly onto physical hardware. This approach presented a significant challenge: how to provide players with complete control over their "virtual hardware lab" while simultaneously ensuring the security isolation and safety of the underlying infrastructure from malicious or accidental damage.
A critical initial step was the selection of the ideal microcontroller (MCU) that would serve as the heart of the platform. The team established a stringent set of requirements:
- Easy Development Environment: It needed strong Arduino support and an existing, large, and established community to minimize the learning curve for players, ruling out many industrial-grade chip families.
- External Control and Debugging: The platform required a clear view of what was running on the processor at all times, with external debugging capabilities. This requirement unfortunately excluded popular 8-bit AVR microcontrollers found in Arduino Uno boards, as their debugging interfaces were deemed insufficient for the required level of control.
- Resilience Against Malicious Code: The chosen chip had to be resilient to permanent modification or damage from untrusted code. This meant avoiding MCUs with easily programmable fuses or one-time programmable (OTP) memory, which could be maliciously altered to brick or compromise the device.
- No Wireless Functionality: To prevent interference with the local radio environment, any wireless capabilities (common in IoT-focused chips like the ESP32) would need to be disabled or the chip avoided entirely.
- Cost-Effectiveness: Crucially, the MCU needed to be cheap, ideally less than a dollar, to enable the deployment of hundreds of units for a large-scale online competition.
After extensive evaluation, the team identified the RP2040, the chip powering the Raspberry Pi Pico, as the perfect fit. It met every requirement, boasting a powerful dual-core ARM processor, ample RAM, fast programmable I/O (PIO) pins essential for precise timing attacks, and a completely stateless design with no fuses or OTP memory. As a Raspberry Pi engineer reportedly stated, the RP2040 was "designed to be absolutely unbreakable," making it uniquely suited for running untrusted code in a shared environment. Its sub-dollar price point further solidified its position as the cornerstone of the hardware platform.
Key Findings
▶ Watch: Overall hardware system topology and challenge cards (5:00)
The Down Under CTF team successfully engineered and deployed a groundbreaking online hardware CTF, demonstrating several key findings and contributions to the field of cybersecurity education and platform development:
- Novel Hardware-Software Stack: They developed a completely custom and novel hardware and software architecture capable of hosting a large-scale online hardware CTF. This stack moved beyond simulation to offer players interaction with real circuits, providing an authentic experience for hardware security challenges.
- Ideal Microcontroller for Untrusted Code: The Raspberry Pi Pico's RP2040 was identified and validated as an exceptionally suitable microcontroller for running untrusted user code in a multi-tenant, online environment. Its stateless design, lack of programmable fuses, inherent resilience, powerful dual-core ARM processor, and low cost (less than $1) made it the cornerstone of the platform.
- Modular and Scalable Hardware Design: A robust and modular hardware topology was designed, comprising a Host, Manager RP2040s, Runner RP2040s, and specialized Challenge Cards. This architecture allowed for efficient provisioning, management, and isolation of individual challenge instances, scaling to 20 managers and approximately 100 runners in production.
- Effective Sandboxing on Physical Hardware: Comprehensive sandboxing mechanisms were implemented to protect the hardware infrastructure from malicious user code. These included strict time limiting, complete isolation between Runners, prevention of overclocking through constant monitoring, and periodic health checks to ensure a known good environment for each player's session.
- Automated Cloud Infrastructure (Eevee): A sophisticated, automated cloud platform named Eevee was built using Rust microservices and the NATS messaging service. This infrastructure managed all aspects of the CTF, from challenge card provisioning and firmware deployment to serial log collection, session management, and rate limiting, ensuring scalability and resilience.
- Diverse Real-World Hardware Challenges: Four distinct hardware challenges were successfully created and deployed, showcasing a range of real-world hardware attack vectors. These included basic I2C communication, exploitation of insecure remote protocols (mimicking Samy Kamkar's Open Sesame), timing side-channel analysis on a bootloader, and exploitation of a known RP2040 RNG flaw in a cryptographic handshake.
- Lowered Barrier to Entry: The platform effectively lowered the barrier to entry for hardware security experimentation, allowing over 4,000 players globally to engage with complex hardware security topics without needing specialized physical equipment, fostering a new generation of hardware security enthusiasts and professionals.
Technical Deep Dive
▶ Watch: Examples of implemented hardware CTF challenges (14:00)
The success of the online hardware CTF hinged on a meticulously designed and integrated hardware and software stack. This section delves into the technical specifics of its architecture, code deployment, security mechanisms, and the supporting cloud infrastructure.
Hardware Architecture
The physical infrastructure adopted a hierarchical, modular topology centered around a host computer:
- Host Computer: This machine orchestrates the entire system, communicating with multiple Managers over USB.
- Managers (RP2040): The team designed custom manager boards, each powered by an RP2040. These managers run custom firmware written in Rust using the Artic (Asynchronous Real-Time Interrupt-driven Concurrency) framework. They connect to the host via USB-C or a custom 5-pin JST connector (for power delivery and hub integration). Each manager exposes six serial endpoints: a management API for request-response communication, a dedicated log stream, and four UART (Universal Asynchronous Receiver-Transmitter) passthrough channels. In production, 20 managers were deployed.
- Runners (RP2040): Each manager connects to four individual Runner RP2040s. These are the microcontrollers that directly execute player-submitted code. Communication between the manager and runners occurs over SWD (Serial Wire Debug) for debugging and flashing, and UART for serial console interaction. Each runner is also equipped with status LEDs for at-a-glance monitoring.
- Challenge Cards: Each runner is directly paired with a unique Challenge Card, which contains the specific hardware components for a given CTF challenge. These cards connect to the runners via a PCI Edge connector. This connector was chosen for its cost-effectiveness, double-sided design, and sufficient I/O lines to provide both power and data. The cards feature an ID EEPROM (accessible via SPI) for identification and can contain additional logic (e.g., an MCU on the card itself) to manage challenge state, release flags under specific conditions, or facilitate resets.
The physical deployment involved plugging numerous USB devices into the host, leading to challenges with the Linux USB stack that required custom modifications to handle the approximately 50 USB serial devices (half the cluster) simultaneously.
Firmware Upload and Execution
The process for getting player-submitted code onto a runner and executing it securely was carefully engineered:
- Firmware Ready: Once the cloud software (running on the host) prepares the player's firmware, it signals the manager.
- Flash Agent Deployment: The manager sets up a "flash agent" – a small piece of shim code – which is installed onto the target runner over SWD. This debug protocol allows direct access to the RP2040 chip, bypassing any existing code on it.
- ROM Routines & Decompression: The flash agent leverages the RP2040's internal ROM routines for writing to flash memory. It also includes functionality to decompress flash images, making the transfer significantly more efficient than sending byte-by-byte over the debug interface.
- Direct Tunneling: Once the flash agent is active and ready, the system establishes a direct tunnel from the host to the runner over UART. This allows the firmware to be sent directly, minimizing manager overhead.
- Code Execution & Termination: The player's code then executes on the runner. Execution is monitored and can be terminated by hitting a predefined breakpoint, a timeout, or other stop conditions.
Sandboxing and Protections
Running untrusted code on physical hardware necessitates robust sandboxing. The team implemented several layers of protection:
- Time Limiting: Each player's job is assigned a strict time limit to prevent resource exhaustion and ensure fair access for all participants.
- Isolation Between Runners: A critical design decision was to avoid a multi-drop SWD bus, where all runners would be connected to a single debug line. Such a setup could allow a malicious player to probe or reprogram other microcontrollers. Instead, all connections are direct between the manager and each individual runner, with the manager acting as a "little switch" to enforce strict isolation.
- No Overclocking: To prevent damage from excessive current draw or overheating (which can degrade transistors and lead to unreliability), the manager constantly polls each runner over SWD to check its clock speed registers. Any attempt to overclock the chip (e.g., to 1 GHz) would draw too much current, tripping a fuse and immediately taking that part of the cluster offline, effectively protecting the system.
- Periodic Health Checks: To ensure a stable and functional environment for every player, the system periodically uploads known good "soul scripts" (diagnostic code) to each challenge card. This verifies that the hardware and communication channels are working correctly before a player's job is initiated.
Cloud Infrastructure (Eevee)
The entire operation was managed by a custom-built cloud platform named Eevee, running on top of the existing Down Under CTF platform.
- Persistent State: All state information (e.g., challenge card allocations, session data) is stored in a MySQL instance.
- Messaging Architecture: The backbone of Eevee is the NATS messaging service, chosen for its lightweight nature, open-source status, support for in-order messaging, and both broadcast and request-reply patterns. Each API endpoint and challenge instance has its own dynamic message topic. All network communications are tunneled through Traefik (their reverse proxy), and mTLS (mutual Transport Layer Security) is used to secure NATS communications without exposing it directly to the public internet.
- Rust Microservices: Eevee comprises five independently scalable Rust microservices, enhancing resilience. Downtime in one service does not lead to a complete platform outage.
- Admin Service: Provides an admin panel for activating/deactivating challenge cards and allows organizers to inspect player submissions.
- Frontend: The main entry point for players, handling code submissions and providing access to logs.
- Terminal Service: A remote serial console that allows players to directly interact with their allocated challenge card by subscribing to its instance topic and relaying messages.
- Agent: Serves as the crucial bridge between the cloud services and the physical hardware clusters. Running on a physical machine (e.g., Hex's laptop), it organizes firmware flashing and communicates with the hardware managers.
- Auditor: Collects all serial logs, aggregates them into a single file for player download, and manages individual session states, including sending kill signals if a challenge card exceeds its allocated time limit.
The submission sequence illustrates the intricate orchestration: a player uploads firmware to a cloud storage bucket; the Agent dequeues the challenge, downloads the firmware, flashes it to a runner, and registers the session with the Frontend; the Auditor then sets up auditing and time limits; serial I/O is continuously streamed via NATS and recorded by the Auditor; the Terminal service can subscribe to this stream; upon timeout or completion, the Auditor broadcasts a termination message, initiating cleanup across all services and uploading the final run log to the bucket.
Hardware Challenges
The platform successfully hosted four diverse hardware challenges:
- I2C: An easy challenge designed to familiarize players with the environment. It required reading data from an I2C EEPROM. The twist was that the EEPROM's address lines were wired high (instead of the usual ground), forcing players to discover the modified I2C address to successfully communicate with the chip.
- Door Alarm: A medium challenge inspired by Samy Kamkar's Open Sesame research into insecure garage door remotes. This challenge involved hardware logic gates, where players had to consider propagation delays and other physical characteristics to exploit a password system.
- Bootloader: A medium challenge featuring a password-protected bootloader. The objective was to perform a timing side-channel analysis on a vulnerable
string comparefunction to deduce the password, a common real-world attack vector. - DCTF (Down on Cabs Trains of Fairies): A hard challenge exploiting a known flaw in the RP2040's Random Number Generator (RNG). Without an external crystal, the RP2040's RNG always reads zero. Players had to leverage this predictability to bypass a Desire 3-way handshake protocol (a simple cryptographic handshake) without knowing the encryption key, by pretending to be a card and predicting the reader's "random" numbers.
Future Directions
The team outlined several exciting future ideas for hardware challenges, including more advanced side-channel analysis (e.g., power analysis to read keys from secure elements), fault injection (e.g., voltage glitching or EMFI - Electromagnetic Fault Injection), RF challenges (sending/receiving data on various frequencies), and even challenges involving custom ASICs, though the latter would require significant sponsorship due to cost.
Demo / Proof of Concept
▶ Watch: The Eevee cloud platform and microservices architecture (18:00)
While the talk did not feature a live, interactive demonstration of the Eevee platform or a real-time walkthrough of solving a challenge, the entire project itself serves as a comprehensive proof of concept. The successful deployment and operation of the platform for over 4,000 players, alongside the detailed explanation of its architecture and the four distinct hardware challenges, unequivocally demonstrate the feasibility and effectiveness of their approach.
The user interface (UI) for the Eevee platform was shown via a screenshot, illustrating the player's perspective when interacting with the system and accessing logs. Furthermore, the detailed walkthrough of the I2C challenge solution by a participant highlights the practical application of the platform. The very existence and successful execution of the "I2C," "Door Alarm," "Bootloader," and "DCTF" challenges stand as concrete demonstrations of the platform's capability to host complex, authentic hardware security scenarios. These challenges, ranging from basic hardware interaction to advanced side-channel and cryptographic exploits, validated the robustness of the custom hardware and software stack.
Defensive Implications
▶ Watch: Q&A: Most unexpected challenges during development (24:00)
The Down Under CTF hardware platform and its associated challenges offer several critical defensive implications for both hardware developers and cybersecurity professionals:
- Secure MCU Selection: The meticulous process of selecting the RP2040 highlights the importance of choosing microcontrollers that are inherently resilient to physical tampering and untrusted code execution. Features like a stateless design, absence of easily modifiable fuses or one-time programmable memory, and robust debugging interfaces are crucial considerations for any embedded system intended for multi-tenant or untrusted environments.
- Robust Sandboxing for Untrusted Code: The implemented sandboxing techniques (time limits, physical isolation, overclocking prevention, health checks) are essential blueprints for any system that runs user-provided code on physical hardware. Defenders should consider similar strategies when designing systems that interact with external, potentially malicious, inputs or firmware updates. This includes continuous monitoring of hardware state and resource usage.
- Awareness of Hardware Vulnerabilities: The challenges themselves directly educate on real-world hardware vulnerabilities.
- I2C Address Manipulation: Simple misconfigurations, like wiring address lines high instead of low, can change device addresses and complicate communication, requiring careful device configuration and validation.
- Insecure Protocols: The "Door Alarm" challenge, based on Open Sesame, underscores the prevalence of weak or predictable authentication protocols in embedded systems (e.g., garage door openers). Developers must prioritize strong cryptographic primitives and secure key exchange mechanisms, even for seemingly simple devices.
- Timing Side-Channels: The "Bootloader" challenge demonstrates that even seemingly innocuous operations like
string comparecan leak sensitive information (e.g., passwords) through subtle timing differences. Developers must implement constant-time algorithms for any operations involving sensitive data, especially in cryptographic contexts. - RNG Weaknesses: The "DCTF" challenge exposed a critical flaw in the RP2040's RNG under specific conditions (absence of an external crystal). This emphasizes the need for robust, well-seeded hardware random number generators (HRNGs) and careful validation of their entropy sources. Relying solely on internal, potentially weak, RNGs can compromise cryptographic protocols.
- Physical Security Considerations: The discussions around preventing overclocking and the potential for fault injection (voltage glitching, EMFI) in future challenges highlight the reality of physical attacks. Defenders must consider physical security measures for critical embedded systems, including tamper detection, environmental monitoring, and robust power supply design to mitigate these advanced threats.
- Scalable and Resilient Infrastructure: The Eevee platform's design, utilizing Rust microservices and NATS messaging, provides a model for building scalable, fault-tolerant infrastructure for managing complex hardware interactions. This architecture ensures that even in large deployments, individual component failures do not cascade into system-wide outages, which is vital for critical infrastructure.
- Education and Skill Development: Providing accessible platforms like this CTF is a crucial defensive strategy in itself. By enabling more individuals to gain hands-on experience with hardware security, it contributes to a larger pool of skilled professionals capable of identifying, analyzing, and mitigating these vulnerabilities in real-world products.
In summary, the Down Under CTF project serves as a powerful reminder that hardware security is not an abstract concept but a practical domain ripe with exploitable vulnerabilities. Its defensive implications range from fundamental MCU selection and robust software engineering practices to advanced physical attack mitigation and the imperative for continuous education in embedded system security.
Key Takeaways
- The RP2040 (Raspberry Pi Pico) is an exceptionally robust and cost-effective microcontroller for secure, multi-tenant hardware environments due to its stateless design, lack of programmable fuses, and powerful dual-core ARM architecture, making it "absolutely unbreakable" for untrusted code execution.
- Building a scalable online hardware CTF requires a novel, custom-designed hardware and software stack, integrating specialized manager and runner boards with a sophisticated cloud infrastructure to provide authentic interaction with real circuits.
- Robust sandboxing techniques, including strict time limiting, complete physical isolation between Runners, prevention of overclocking via SWD monitoring, and periodic health checks, are critical for safely running untrusted user code on shared physical hardware.
- The Eevee cloud platform, built with Rust microservices and the NATS messaging service, demonstrates an effective architecture for automating, managing, and scaling complex hardware interactions, ensuring high availability and auditability for a large player base.
- Real-world hardware vulnerabilities, such as timing side-channel analysis on string comparisons, insecure remote protocols (like those in Open Sesame), and RNG flaws (e.g., the RP2040's RNG without an external crystal), can be effectively taught and exploited in a controlled, virtualized hardware lab environment.
- This project significantly lowers the barrier to entry for hardware security education, enabling thousands of participants to gain hands-on experience with embedded system exploitation without needing specialized physical equipment, fostering a new generation of hardware security expertise.
About the Speaker(s)
The talk was presented by three individuals integral to the Down Under CTF team:
- Thomas Hobson (aka Hex F): A Computer Engineering Student at the University of Canterbury. Thomas played a significant role in designing and building the custom hardware architecture, including the manager and runner boards, and implementing the firmware for these components.
- Emily Trau: Also a key member of the team, Emily contributed to the overall vision and execution of the hardware CTF, particularly in the initial design phases and microcontroller selection.
- Tom Nguyen (aka Dot): A Software Engineer, Tom was responsible for developing the sophisticated cloud infrastructure (Eevee), including the Rust microservices and NATS messaging system, which managed the entire online operation of the CTF.
Together, their combined expertise in hardware engineering, embedded systems, and scalable cloud infrastructure was essential in bringing this ambitious online hardware CTF to fruition.
Reviews
- Dr. Zero (Offensive Security Researcher) — MUST SEE ★★★★★