facedancer.proxy module
USB Proxy implementation.
- class facedancer.proxy.LibUSB1Device[source]
Bases:
objectA wrapper around the proxied device based on libusb1.
- context = None
Class variable that stores our device handle.
- device_handle = None
- class facedancer.proxy.USBProxyDevice(index=0, quirks=[], scheduler=None, **kwargs)[source]
Bases:
USBBaseDeviceUSB Proxy Device
- configured(configuration: USBConfiguration)[source]
Callback that handles when the target device becomes configured. If you’re using the standard filters, this will be called automatically; if not, you’ll have to call it once you know the device has been configured.
- Parameters:
configuration – The configuration to be applied.
- connect()[source]
Initialize this device. We perform a reduced initialization, as we really only want to proxy data.
- filter_list = []
- handle_data_available(ep_num, data)[source]
Handles the case where data is ready from the Facedancer device that needs to be proxied to the target device.
- handle_nak(ep_num)[source]
Handles a NAK, which means that the target asked the proxied device to participate in a transfer. We use this as our cue to participate in communications.
- handle_request(request: USBControlRequest)[source]
Proxies EP0 requests between the victim and the target.
- interface_changed(interface_number: int, alternate: int)[source]
Callback that handles when a SET_INTERFACE request is made to the target. If you’re using the standard filters, this will be called automatically; if not, you’ll have to call it once you know an alternate setting has been applied.
- Parameters:
interface_number – The interface number.
alternate – The alternate setting to be applied.
- name: str = 'USB Proxy Device'