usb-tools / USBProxy-legacy

A proxy for USB devices, libUSB and gadgetFS - this project is unmaintained, try here: https://github.com/usb-tools/Facedancer
GNU General Public License v2.0
431 stars 102 forks source link

about a network interface on USB #16

Closed kalab1998e closed 2 years ago

kalab1998e commented 9 years ago

I'm trying to modify USBProxy so that it inspects USB network interface. But It doesn't yet run well. Actually USBProxy said 'timeout' after when Host told 'Network connection (A1 00 01 00 00 00 00 00)' to Device (a USB Network Interface such as USB tethering on an Android smartphone). Do you have any idea to run well?

Script started on Fri 05 Sep 2014 01:49:56 AM UTC
root@arm:~/Projects/USBProxy/build# tools/usb-mitm -l -dd
SIGRTMIN: 34
CP: Vector Plugins
CP: Pointer PacketFilter_StreamLog::file
CP: String DeviceProxy = DeviceProxy_LibUSB
CP: String HostProxy = HostProxy_GadgetFS
Loading plugins from /usr/local/lib/USBProxy/
vendorId=ffffffff
productId=ffffffff
cleaning up /tmp
removing 0
Made directory /tmp/gadget-3Gdmhb for gadget
Printing Config data
    Strings: 2
        DeviceProxy: DeviceProxy_LibUSB
        HostProxy: HostProxy_GadgetFS
    Vectors: 1
        Plugins:
            PacketFilter_StreamLog
Pointer: 1
        PacketFilter_StreamLog::file: 0xb6e18540
Made directory /tmp/mqueue-fwvHwV for mqueue
cleaning up /tmp/mqueue-fwvHwV
removing 3
Device: 12 01 00 02 02 00 00 40 e8 04 5d 68 28 02 02 03 04 01
  Manufacturer: SAMSUNG
  Product:      SAMSUNG_Android_SC-06D
  Serial:       d0120973
    *Config(1): 09 02 5e 00 02 01 00 c0 30
        Interface(0):
            *Alt(0): 09 04 00 00 01 02 0d 00 05
               Name: CDC Network Control Model (NCM)
            Other(24): 05 24 00 10 01
            Other(24): 05 24 06 00 01
            Other(24): 0d 24 0f 07 00 00 00 00 ea 05 00 00 00
            Other(24): 06 24 1a 00 01 11
                EP(82): 07 05 82 03 10 00 09
             Alt(2): 08 0b 00 02 02 0d 00 08 08
               Name: CDC NCM
        Interface(1):
            *Alt(0): 09 04 01 00 00 0a 00 01 06
               Name: CDC Network Data
             Alt(1): 09 04 01 01 02 0a 00 01 06
               Name: CDC Network Data
                EP(81): 07 05 81 02 00 02 00
                EP(01): 07 05 01 02 00 02 00
HS Qualifier: 0a 06 00 02 02 00 00 40 01 00
     Config(1): 09 07 5e 00 02 01 00 c0 30
        Interface(0):
            *Alt(0): 09 04 00 00 01 02 0d 00 05
               Name: CDC Network Control Model (NCM)
            Other(24): 05 24 00 10 01
            Other(24): 05 24 06 00 01
            Other(24): 0d 24 0f 07 00 00 00 00 ea 05 00 00 00
            Other(24): 06 24 1a 00 01 11
                EP(82): 07 05 82 03 10 00 20
             Alt(2): 08 0b 00 02 02 0d 00 08 08
               Name: CDC NCM
        Interface(1):
            *Alt(0): 09 04 01 00 00 0a 00 01 06
               Name: CDC Network Data
             Alt(1): 09 04 01 01 02 0a 00 01 06
               Name: CDC Network Data
                EP(81): 07 05 81 02 40 00 00
                EP(01): 07 05 01 02 40 00 00
searching in [/tmp/gadget-3Gdmhb]
Starting setup writer thread (5120) for EP00.
Starting setup reader thread (5119) for EP00.
[80 06 00 03 00 00 ff 00]
[80 06 00 03 00 00 04 00]: 04 03 09 04
[80 06 03 03 09 04 ff 00]
[80 06 03 03 09 04 2e 00]: 
    2e 03 53 00 41 00 4d 00 53 00 55 00 4e 00 47 00 5f 00 41 00 6e 00 64 00 72 00 6f 00 69 00 64 00
    5f 00 53 00 43 00 2d 00 30 00 36 00 44 00
[80 06 02 03 09 04 ff 00]
[80 06 02 03 09 04 10 00]: 10 03 53 00 41 00 4d 00 53 00 55 00 4e 00 47 00
[80 06 04 03 09 04 ff 00]
[80 06 04 03 09 04 12 00]: 12 03 64 00 30 00 31 00 32 00 30 00 39 00 37 00 33 00
[40 f0 01 00 4c 05 00 00]
[00 09 01 00 00 00 00 00]
Opened EP82
[80 06 05 03 09 04 ff 00]
[80 06 05 03 09 04 40 00]: 
    40 03 43 00 44 00 43 00 20 00 4e 00 65 00 74 00 77 00 6f 00 72 00 6b 00 20 00 43 00 6f 00 6e 00
    74 00 72 00 6f 00 6c 00 20 00 4d 00 6f 00 64 00 65 00 6c 00 20 00 28 00 4e 00 43 00 4d 00 29 00p
Starting writer thread (5122) for EP82.
[01 0b 00 00 01 00 00 00]
[a1 80 00 00 00 00 1c 00]
[a1 80 00 00 00 00 1c 00]: 1c 00 03 00 00 08 00 00 04 00 00 00 04 00 00 00 00 40 00 00 04 00 00 00 04 00 00 00
[21 8a 00 00 00 00 00 00]
Starting reader thread (5121) for EP82.
[21 84 00 00 00 00 00 00]
[01 0b 01 00 01 00 00 00]
[80 06 07 03 09 04 ff 00]
[80 06 07 03 09 04 1a 00]: 1a 03 30 00 32 00 35 00 44 00 30 00 37 00 30 00 32 00 33 00 32 00 33 00 30 00
[80 06 06 03 09 04 ff 00]
[80 06 06 03 09 04 22 00]: 
    22 03 43 00 44 00 43 00 20 00 4e 00 65 00 74 00 77 00 6f 00 72 00 6b 00 20 00 44 00 61 00 74 00
    61 00
82[16]: a1 2a 00 00 00 00 08 00 00 00 64 19 00 00 64 19
82[8]: a1 00 01 00 00 00 00 00
/root/Projects/USBProxy/src/Plugins/Devices/DeviceProxy_LibUSB.cpp receive_data() 316 libusb_interrupt_transfer timed out
/root/Projects/USBProxy/src/Plugins/Devices/DeviceProxy_LibUSB.cpp receive_data() 316 libusb_interrupt_transfer timed out
/root/Projects/USBProxy/src/Plugins/Devices/DeviceProxy_LibUSB.cpp receive_data() 316 libusb_interrupt_transfer timed out
/root/Projects/USBProxy/src/Plugins/Devices/DeviceProxy_LibUSB.cpp receive_data() 316 libusb_interrupt_transfer timed out
/root/Projects/USBProxy/src/Plugins/Devices/DeviceProxy_LibUSB.cpp receive_data() 316 libusb_interrupt_transfer timed out
/root/Projects/USBProxy/src/Plugins/Devices/DeviceProxy_LibUSB.cpp receive_data() 316 libusb_interrupt_transfer timed out
/root/Projects/USBProxy/src/Plugins/Devices/DeviceProxy_LibUSB.cpp receive_data() 316 libusb_interrupt_transfer timed out
/root/Projects/USBProxy/src/Plugins/Devices/DeviceProxy_LibUSB.cpp receive_data() 316 libusb_interrupt_transfer timed out
/root/Projects/USBProxy/src/Plugins/Devices/DeviceProxy_LibUSB.cpp receive_data() 316 libusb_interrupt_transfer timed out
^CReceived SIGINT, stopping relaying...
Finished setup reader thread (5119) for EP00.
Finished setup writer thread (5120) for EP00.
/root/Projects/USBProxy/src/Plugins/Devices/DeviceProxy_LibUSB.cpp receive_data() 316 libusb_interrupt_transfer timed out
Finished writer thread (5122) for EP82.
Finished reader thread (5121) for EP82.
*** glibc detected *** tools/usb-mitm: double free or corruption (out): 0x00016c98 ***
Aborted
root@arm:~/Projects/USBProxy/build# exit

Script done on Fri 05 Sep 2014 01:50:15 AM UTC
dominicgs commented 9 years ago

Is this solved by the pull request that you sent to me?

kalab1998e commented 9 years ago

A part of this problem is solved, but it's not all. I'm tracing behavior of USBProxy using BeagleUSB480Power. Now, I'm checking a strange Interface descriptor 'Alt(2): 08 0b 00 02 02 0d 00 08 08 Name: CDC NCM'

straithe commented 2 years ago

@kalab1998e are you still experiencing this issue?

straithe commented 2 years ago

I'm going to close this as there hasn't been a response in a while, but please re-open this issue or open a new one if you still need assistance.