Using Cynthion with USB Proxy

Together with USB Proxy, Cynthion can proxy packets between a target host and a target device attached to the control computer.

Before proceeding, please ensure you have completed all steps in the Getting Started with Cynthion and Using Cynthion with Facedancer sections.

Connect Hardware

Connection diagram for using Cynthion with Facedancer.

Run a USB Proxy example

Create a new Python file called usbproxy.py with the following content:

 1#!/usr/bin/env python3
 2#
 3# This file is part of Facedancer.
 4#
 5""" USB Proxy example; forwards all USB transactions and logs them to the console. """
 6
 7from facedancer          import main
 8
 9from facedancer.proxy    import USBProxyDevice
10from facedancer.filters  import USBProxySetupFilters, USBProxyPrettyPrintFilter
11
12# replace with the proxied device's information
13ID_VENDOR  = 0x1050
14ID_PRODUCT = 0x0407
15
16
17if __name__ == "__main__":
18    # create a USB Proxy Device
19    proxy = USBProxyDevice(idVendor=ID_VENDOR, idProduct=ID_PRODUCT)
20
21    # add a filter to forward control transfers between the target host and
22    # proxied device
23    proxy.add_filter(USBProxySetupFilters(proxy, verbose=0))
24
25    # add a filter to log USB transactions to the console
26    proxy.add_filter(USBProxyPrettyPrintFilter(verbose=5))
27
28    main(proxy)

Open a terminal and run:

python ./usbproxy.py

Note

USBProxy requires root privileges on macOS in order to claim the device being proxied from the operating system.

sudo python ./usbproxy.py
python ./usbproxy.py

If all goes well you should see the output from device enumeration in your terminal and the proxied USB device should be detected by the target computer.

More Information

For further information, see the Facedancer USB Proxy documentation.