facedancer.filters.standard module

Standard filters for USBProxy that should (almost) always be used.

class facedancer.filters.standard.USBProxySetupFilters(device, verbose=0)[source]

Bases: USBProxyFilter

DESCRIPTOR_CONFIGURATION = 2
DESCRIPTOR_DEVICE = 1
GET_DESCRIPTOR_REQUEST = 6
MAX_PACKET_SIZE_EP0 = 64
RECIPIENT_DEVICE = 0
RECIPIENT_INTERFACE = 1
SET_ADDRESS_REQUEST = 5
SET_CONFIGURATION_REQUEST = 9
SET_INTERFACE_REQUEST = 11
filter_control_in(req, data, stalled)[source]

Filters the data response from the proxied device during an IN control request. This allows us to modify the data returned from the proxied device during a setup stage.

Parameters:
  • request – The request that was issued to the target host.

  • data – The data being proxied during the data stage.

  • stalled – True if the proxied device (or a previous filter) stalled the request.

Returns:

Modified versions of the arguments. Note that modifying request will _only_ modify the request as seen by future filters, as the SETUP stage has already passed and the request has already been sent to the device.

filter_control_out(req, data)[source]

Filters handling of an OUT control request, which contains both a request and (optional) data stage.

Parameters:
  • request – The request issued by the target host.

  • data – The data sent by the target host with the request.

Returns:

Modified versions of the arguments. Returning a request of None will absorb the packet silently and not proxy it to the device.