facedancer
facedancer copied to clipboard
USBMassStorageInterface / USBEndpoint object has no attribute device_class
While testing numap-scan
from nu-map's (https://github.com/sprout42/nu-map/tree/umap2_python3_updates) against facedancer's current master branch (2281b57b579f), I encounter the following error:
[ERROR ] Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/numap-2.0.2-py3.6.egg/numap/apps/scan.py", line 50, in run
device.run()
File "/usr/local/lib/python3.6/dist-packages/Facedancer-2019.3.2-py3.6.egg/facedancer/USBDevice.py", line 166, in run
self.scheduler.run()
File "/usr/local/lib/python3.6/dist-packages/Facedancer-2019.3.2-py3.6.egg/facedancer/core.py", line 506, in run
task()
File "/usr/local/lib/python3.6/dist-packages/Facedancer-2019.3.2-py3.6.egg/facedancer/USBDevice.py", line 84, in
I still need to investigate a bit further to see why USBEndpoint causes this.
I get a similar issue when trying to use numap-emulate -C mass_storage
:
[ERROR ] Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/numap-2.0.2-py3.6.egg/numap/apps/emulate.py", line 42, in run
self.dev.run()
File "/usr/local/lib/python3.6/dist-packages/Facedancer-2019.3.2-py3.6.egg/facedancer/USBDevice.py", line 166, in run
self.scheduler.run()
File "/usr/local/lib/python3.6/dist-packages/Facedancer-2019.3.2-py3.6.egg/facedancer/core.py", line 506, in run
task()
File "/usr/local/lib/python3.6/dist-packages/Facedancer-2019.3.2-py3.6.egg/facedancer/USBDevice.py", line 84, in
By the way, this appears to be DUT (device-under-test) behavior related. Mass-storage emulator worked when the DUT was my Ubuntu 18.04 laptop, but not the other DUT I am focused on. I will try to post more logs tonight.
And I am using GreatFET One with the latest firmware and host-tools.
numap-scan log (not DUT dependent, both choke on the same packet from host):
After decoding and looking back at the error, things are starting to make sense. The host is sending a SETUP packet with a "class" type with the "endpoint" as the recipient. Then I guess a bRequest = 1 isn't being handled by the endpoint. In this case, the first class of devices being scanned for is Audio. Below is the emulated Audio configuration.
The question I have is whether this issue belongs in Facedancer or Numap. At a minimum I think Facedancer should handle all request types more gracefully... Maybe catch the exception, print a statement about unhandled request, and continue to raise the exception?
On the other hand, if the host is asking us to do something with the Audio class' endpoint, the numap-scan can probably assume the host supports audio peripherals and move on, right?