forked from nccgroup/umap2
-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
technical supportrequest for technical supportrequest for technical support
Description
numap-emulate -C mass_storage
numap-emulate -C mass_storage fails with s = self.strings[num - 1].encode('utf-16') AttributeError: 'bytes' object has no attribute 'encode'
The main reason is that the serial number in the descriptor is actually a byte array
DEBUG:numap:[MassStorageDevice] get_string_descriptor: 0x3 (0x4)
[ERROR ] Traceback (most recent call last):
"Fixed" this issue by converting the byte array to a string e.g.
diff --git a/numap/dev/mass_storage.py b/numap/dev/mass_storage.py
index 1db061c..577ed0f 100644
--- a/numap/dev/mass_storage.py
+++ b/numap/dev/mass_storage.py
@@ -528,7 +528,7 @@ class USBMassStorageDevice(USBDevice):
device_rev=rev,
manufacturer_string='PNY',
product_string='USB 2.0 FD',
- serial_number_string=b'4731020ef1914da9',
+ serial_number_string='4731020ef1914da9',
configurations=[
USBConfiguration(
app=app,
ERROR:numap:Traceback (most recent call last):
File "/home/pentest/projects/nu-map/numap/apps/emulate.py", line 42, in run
self.dev.run()
File "/home/pentest/projects/Facedancer/facedancer/USBDevice.py", line 165, in run
self.scheduler.run()
File "/home/pentest/projects/Facedancer/facedancer/core.py", line 509, in run
task()
File "/home/pentest/projects/Facedancer/facedancer/USBDevice.py", line 83, in <lambda>
self.scheduler.add_task(lambda : self.maxusb_app.service_irqs())
File "/home/pentest/projects/Facedancer/facedancer/backends/greatdancer.py", line 765, in service_irqs
self._handle_setup_events()
File "/home/pentest/projects/Facedancer/facedancer/backends/greatdancer.py", line 368, in _handle_setup_events
self._handle_setup_event_on_endpoint(i)
File "/home/pentest/projects/Facedancer/facedancer/backends/greatdancer.py", line 402, in _handle_setup_event_on_endpoint
self.connected_device.handle_request(request)
File "/home/pentest/projects/Facedancer/facedancer/USBDevice.py", line 251, in handle_request
handler(req)
File "/home/pentest/projects/Facedancer/facedancer/USBDevice.py", line 326, in handle_get_descriptor_request
response = response(dindex)
File "/home/pentest/projects/nu-map/numap/core/usb_device.py", line 290, in handle_get_string_descriptor_request
return self.get_string_descriptor(num)
File "/home/pentest/projects/nu-map/numap/fuzz/helpers.py", line 81, in wrapper
raise e
File "/home/pentest/projects/nu-map/numap/fuzz/helpers.py", line 77, in wrapper
response = func(self, *args, **kwargs)
File "/home/pentest/projects/nu-map/numap/core/usb_device.py", line 269, in get_string_descriptor
s = self.strings[num - 1].encode('utf-16')
AttributeError: 'bytes' object has no attribute 'encode'
Metadata
Metadata
Assignees
Labels
technical supportrequest for technical supportrequest for technical support