Facedancer Examples

There are a number of Facedancer examples available that demonstrate emulation of various USB device functions.

rubber-ducky.py

The canonical “Hello World” of USB emulation, the rubber-ducky example implements a minimal subset of the USB HID class specification in order to emulate a USB keyboard.

Host Compatibility

Linux

macOS

Windows

ftdi-echo.py

An emulation of an FTDI USB-to-serial converter, the ftdi-echo example converts input received from a connected terminal to uppercase and echoes the result back to the sender.

Host Compatibility

Linux

macOS

Windows

mass-storage.py

An emulation of a USB Mass Storage device, the mass-storage example can take a raw disk image file as input and present it to a target host as drive that can be mounted, read and written to.

You can create an empty disk image for use with the emulation using:

dd if=/dev/zero of=disk.img bs=1M count=100
mkfs -t ext4 disk.img

You can also test or modify the disk image locally by mounting it with:

mount -t auto -o loop disk.img /mnt

Remember to unmount it before using it with the device emulation!

Host Compatibility

Linux

macOS

Windows