3. FaultyCMD - ElectronicCats/faultycat GitHub Wiki

What is FaultyCMD

FaultyCMD is the official host-side tool and unified command-line interface (CLI) / terminal user interface (TUI) designed for driving the FaultyCat v3 hardware board. Built and maintained by Electronic Cats / PWNLab, this tool centralizes all core capabilities into a single binary, completely replacing legacy standalone scripts and reference clients.

By automating complex hardware configurations, protocol framing (using CRC16-CCITT), and cross-platform port mappings, FaultyCMD eliminates environment friction, allowing researchers to focus entirely on vulnerability analysis, glitch timing, and pinout discovery.

Key Capabilities

FaultyCMD utilizes a Click + Rich-powered CLI alongside an interactive, keyboard-driven Textual TUI to orchestrate advanced hardware security workflows over FaultyCat's USB CDC composite interface.

  • Multi-Engine Control Centralization: Seamlessly manages independent hardware engines for Electromagnetic Fault Injection (EMFI), Crowbar (voltage glitching), parameter sweeps, $I^2C$ bus probing, and a protocol-agnostic logic analyzer via a unified terminal environment.

  • Intuitive 2×2 TUI Dashboard: Features an interactive interface with dedicated modals for real-time configuration, instant trigger modifications, and critical safety validations—such as a mandatory High-Voltage confirmation before arming EMFI.

  • Automated Sweep Campaigns: Orchestrates complex multi-variable parameter sweeps (modulating delays, pulse widths, and power levels) over the underlying glitch hardware, featuring real-time diagnostic logging and runtime pause/stop controls.

  • Hardware Pinout Discovery & Scanning: Automatically scans target interfaces (including SWD, JTAG, and Serial pin mapping permutations) utilizing isolated text-shell interactions over dedicated communication channels.

  • Platform & Version Safety: Bundles cross-platform port fallback detection (leveraging pyserial and udevadm) and strictly enforces host-to-firmware version parity checks to guarantee predictable wire-protocol behavior during operations.

[!Warning] FaultyCat is a fault-injection tool intended solely for authorized security research and testing on hardware you own or have explicit permission to test. Electronic Cats/PWNLab holds no responsibility for unauthorized use or resulting damage.

Target Audience

  • Hardware Security Researchers: Analyzing chip vulnerabilities, bypassing bootloaders, and executing physical fault injection attacks (EMFI/Glitching).

  • Embedded Firmware Developers: Testing the resilience of firmware implementations against hardware-level disturbances and side-channel variations.

  • Hardware Pentesters: Assessing the physical attack surface of secure microcontrollers, IoT devices, and automotive components.

  • Reverse Engineers: Utilizing hardware scanning capabilities to map out obfuscated debug interfaces (SWD/JTAG) on target printed circuit boards (PCBs).

What does FaultyCMD contain?

  • faultycmd/: this is the application code

    • cli.py & tui.py: these are the main scripts and the entry points, providing access to all system functionalities through either a command-line interface or an interactive terminal user interface.

    • framing.py: Handles CRC16-CCITT generation and frame building/parsing for the wire protocol.

    • usb.py: Implements cross-platform serial port detection and CDC mapping logic across Linux, Windows, and macOS.

    • persistence.py: Manages the XDG storage configuration states for individual hardware engines.

    • tui_modals.py: Defines the user-interactive modal control screens for safe hardware operations.

  • protocols/: Subdirectory containing specific communication clients and abstraction wrappers for each engine, including:

    • emfi.py: Protocol client driver for the Electromagnetic Fault Injection engine.

    • crowbar.py: Protocol client driver for the voltage glitching (crowbar) engine.

    • campaign.py: Parameter sweep manager multiplexed over the underlying EMFI and crowbar protocols.

    • scanner.py: Driver for the target hardware text shell, exposing SWD and serial bus interrogation routines.

    • dap.py: Integration wrapper stub for pyocd and cmsis-dap communication.