BalCCon2k25

Attacking USB with Raw Gadget
2025-09-19 , Pupin

This workshop serves as an introduction to the USB hacking topic in general and to Raw Gadget specifically.

Raw Gadget is a low-level interface for the Linux USB Gadget subsystem. Raw Gadget allows turning any Linux-based board (like a Raspberry Pi) into a USB hacking tool that can emulate and proxy USB devices (similar to the Facedancer boards).

The workshop gives an overview of the USB protocol, the Linux USB Gadget subsystem, and the Raw Gadget interface. The offered hands-on exercises include capturing and analyzing the communication of USB devices, emulating USB devices via Raw Gadget, and proxying USB devices via Raw Gadget and libusb to aid reverse engineering.

Note that you must bring and prepare your own hardware to attend the workshop: see the list in the workshop instructions.


(This is meant to be published or otherwise shared to the workshop participants.)

Discussed topics:

  • Overview of the USB protocol;
  • Sniffing and analyzing USB communication;
  • Overview of the Linux USB Gadget subsystem;
  • Overview and usage of Raw Gadget;
  • Emulating USB devices via Raw Gadgeti;
  • Proxying USB devices via Raw Gadget and libusb to aid reverse engineering.

Participant requirements:

  • Knowing how to use Linux command-line tools (bash, ssh, vim/nano/emacs, etc.);
  • Basic knowledge of the C programming language.

Hardware and software requirements (hardware not provided, you must bring your own):

Andrey Konovalov is a researcher focusing on the Linux kernel and USB security areas. Andrey implemented the Raw Gadget interface discussed in the workshop and also maintains a list of USB hacking– related links. See xairy.io for all of Andrey's articles, talks, projects, and trainings.