HydraBus

What is HydraBus?

HydraBus is an open-source hardware hacking tool designed as a more powerful alternative to Bus Pirate. Based on an STM32 microcontroller, it offers extended capabilities for analysis, debugging and pentesting of embedded systems.

Supported Protocols

  • Serial communication: UART, SPI, I2C
  • Wired buses: 1-Wire, 2-Wire, 3-Wire
  • Automotive/Industrial: CAN, LIN
  • Debug: JTAG, SWD
  • Cards: SMARTCARD, Wiegand, NAND Flash
  • Analog: ADC, DAC, PWM
  • Analysis: Logic Analyzer

Installation

Dependencies

Install required packages for building and flashing the firmware:

sudo dnf install git dfu-util make gcc arm-none-eabi-gcc arm-none-eabi-binutils arm-none-eabi-newlib

udev rules

Configure udev rules to allow access to HydraBus without root privileges:

sudo curl -o /etc/udev/rules.d/09-hydrabus.rules https://raw.githubusercontent.com/hydrabus/hydrafw/master/utils/udev-rules/09-hydrabus.rules
sudo udevadm control --reload-rules

Firmware

Clone the repository, build and flash the firmware:

git clone https://github.com/hydrabus/hydrafw --recursive
cd hydrafw/src
make
dfu-util -d 0483:df11 -a 0 -D build/hydrafw.dfu

To enter DFU mode, hold the left button (UBTN) while connecting the bottom USB port to your computer:

HydraBus DFU mode

Usage

Disconnect and reconnect the USB cable without pressing the button, then connect via serial:

minicom -D /dev/ttyACM0

You will get a shell with the following commands:

> help
Available commands
   help           Available commands
   history        Command history
   clear          Clear screen
   show           Show information
   logging        Turn logging on or off
   sd             SD card management
   adc            Read analog values
   dac            Write analog values
   pwm            Write PWM
   frequency      Read frequency
   continuity     Test continuity
   gpio           Get or set GPIO pins
   spi            SPI mode
   i2c            I2C mode
   1-wire         1-wire mode
   2-wire         2-wire mode
   3-wire         3-wire mode
   uart           UART mode
   nfc            NFC mode
   can            CAN mode
   sump           SUMP mode
   jtag           JTAG mode
   random         Random number
   flash          NAND flash mode
   wiegand        Wiegand mode
   lin            LIN mode
   smartcard      SMARTCARD mode
   debug          Debug mode

pyHydrabus

pyHydrabus is a Python (3.6+) module that can be used to control the HydraFW from a Python script.

pip install pyHydrabus

References