efforg/rayhunter#249

View on GitHub →
#249 Using WSL2 and USBIPD-WIN to bridge USB into a WSL instance to install via windows

Notes:

PS> denotes an administrative powershell prompt $ denotes Ubuntu prompt in WSL

Specs

I used latest stable WSL2:

PS> wsl --version
WSL version: 2.4.13.0
Kernel version: 5.15.167.4-1
WSLg version: 1.0.65
MSRDC version: 1.2.5716
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26120.3653

With Ubuntu 24.04:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.2 LTS
Release:        24.04
Codename:       noble

Steps I followed (adapted from here)

  1. Install USBIPD (in an administrator Posh terminal)
PS> winget install --interactive --exact dorssel.usbipd-win
  1. Install prereqs on Ubuntu
$ sudo apt install linux-tools-generic hwdata adb usbutils
  1. Plug in USB to RC400L and power on. After you hear the windows new device sound, list the usb devices:
PS> usbipd list
Connected:
BUSID  VID:PID    DEVICE                                                        STATE
2-1    0bda:5852  Realtek Bluetooth Adapter                                     Not shared
2-2    048d:c103  USB Input Device                                              Not shared
2-3    048d:c985  USB Input Device                                              Not shared
4-1    05c6:f601  MDM9207-MTP _SN:115642E9, Android Composite ADB Interface     Shared
6-1    046d:c52b  Logitech USB Input Device, USB Input Device                   Not shared
6-4    04f2:b7b6  Integrated Camera, Camera DFU Device, Tobii Experience        Not shared
  1. Note the BUSID of the MDM9207-MTP _SN:115642E9, Android Composite ADB Interface device. It may also register as Remote NDIS based Internet Sharing Device (the second one I used looked like this)
  2. Bind the device:
PS> usbipd bind --busid <bus id from above>
  1. Attach the device to your running WSL session:
PS> usbipd attach --wsl --busid <bus id from above>
usbipd: info: Using WSL distribution 'Ubuntu-24.04' to attach; the device will be available in all WSL 2 distributions.
usbipd: info: Detected networking mode 'nat'.
usbipd: info: Using IP address 172.28.96.1 to reach the host.
  1. Inside the un-tarred rayhunter release folder, run the install script
~/rayhunter$ ./install.sh
Using adb at /usr/bin/adb
Force a switch into the debug mode to enable ADB
adb enabled, waiting for reboot... it's alive!
waiting for atfwd_daemon to startup... done!
./rootshell: 1 file pushed, 0 skipped. 1059.3 MB/s (688868 bytes in 0.001s)
uid=0(root) gid=0(root)
we have root!
./config.toml.example: 1 file pushed, 0 skipped. 6.6 MB/s (389 bytes in 0.000s)
./rayhunter-daemon: 1 file pushed, 0 skipped. 3.4 MB/s (4613352 bytes in 1.310s)
./scripts/rayhunter_daemon: 1 file pushed, 0 skipped. 4.0 MB/s (580 bytes in 0.000s)
./scripts/misc-daemon: 1 file pushed, 0 skipped. 25.1 MB/s (2302 bytes in 0.000s)
waiting for reboot... 
  1. When the device restarts and windows makes the usb connect sounds again, re-attach the USB port to Linux
PS> usbipd attach --wsl --busid 4-1
  1. Back in Ubuntu, script will detect the device again and continue:
~/rayhunter$ ./install.sh
Using adb at /usr/bin/adb
Force a switch into the debug mode to enable ADB
adb enabled, waiting for reboot... it's alive!
waiting for atfwd_daemon to startup... done!
./rootshell: 1 file pushed, 0 skipped. 1059.3 MB/s (688868 bytes in 0.001s)
uid=0(root) gid=0(root)
we have root!
./config.toml.example: 1 file pushed, 0 skipped. 6.6 MB/s (389 bytes in 0.000s)
./rayhunter-daemon: 1 file pushed, 0 skipped. 3.4 MB/s (4613352 bytes in 1.310s)
./scripts/rayhunter_daemon: 1 file pushed, 0 skipped. 4.0 MB/s (580 bytes in 0.000s)
./scripts/misc-daemon: 1 file pushed, 0 skipped. 25.1 MB/s (2302 bytes in 0.000s)
waiting for reboot... done!
checking for rayhunter server...success!
you can access rayhunter at http://localhost:8080

Happy hunting!

Comments (1)

I noticed trying to get this working this weekend (ultimately successfully), that it appearing as the “ADB Interface” rather than the stock device name assumes you’ve already forced adb. Also working in an AlmaLinux9 WSL2 terminal I had to unmask and start udev with appropriate rules to get it to show up.