fusee-launcher icon indicating copy to clipboard operation
fusee-launcher copied to clipboard

Error when injecting payload on linux

Open tzechco opened this issue 5 years ago • 5 comments

When I try to inject a payload I get this error. I am running Ubuntu 18.04.2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "fusee-launcher.py", line 606, in <module>
    raise e
  File "fusee-launcher.py", line 601, in <module>
    device_id = switch.read_device_id()
  File "fusee-launcher.py", line 543, in read_device_id
    return self.read(16)
  File "fusee-launcher.py", line 500, in read
    return self.backend.read(length)
  File "fusee-launcher.py", line 118, in read
    return bytes(self.dev.read(0x81, length, 1000))
  File "/home/tyler/.local/lib/python3.6/site-packages/usb/core.py", line 975, in read
    intf, ep = self._ctx.setup_request(self, endpoint)
  File "/home/tyler/.local/lib/python3.6/site-packages/usb/core.py", line 102, in wrapper
    return f(self, *args, **kwargs)
  File "/home/tyler/.local/lib/python3.6/site-packages/usb/core.py", line 215, in setup_request
    intf, ep = self.get_interface_and_endpoint(device, endpoint_address)
  File "/home/tyler/.local/lib/python3.6/site-packages/usb/core.py", line 102, in wrapper
    return f(self, *args, **kwargs)
  File "/home/tyler/.local/lib/python3.6/site-packages/usb/core.py", line 225, in get_interface_and_endpoint
    for intf in self.get_active_configuration(device):
  File "/home/tyler/.local/lib/python3.6/site-packages/usb/core.py", line 102, in wrapper
    return f(self, *args, **kwargs)
  File "/home/tyler/.local/lib/python3.6/site-packages/usb/core.py", line 236, in get_active_configuration
    self.managed_open()
  File "/home/tyler/.local/lib/python3.6/site-packages/usb/core.py", line 102, in wrapper
    return f(self, *args, **kwargs)
  File "/home/tyler/.local/lib/python3.6/site-packages/usb/core.py", line 120, in managed_open
    self.handle = self.backend.open_device(self.dev)
  File "/home/tyler/.local/lib/python3.6/site-packages/usb/backend/libusb1.py", line 786, in open_device
    return _DeviceHandle(dev)
  File "/home/tyler/.local/lib/python3.6/site-packages/usb/backend/libusb1.py", line 643, in __init__
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "/home/tyler/.local/lib/python3.6/site-packages/usb/backend/libusb1.py", line 595, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 13] Access denied (insufficient permissions)

tzechco avatar Jul 14 '19 01:07 tzechco

Your user doesn't have permission to access "userland" USB devices. You can either run the command with sudo or craft some udev rules that'll ensure you have the relevant permissions.

(I'm going to guess @Qyriad would welcome anyone PR'ing a contrib directory with some udev rules in it.)

ktemkin avatar Jul 15 '19 03:07 ktemkin

i tried running with sudo and now i get this error

Setting ourselves up to smash the stack...
Uploading payload...
Smashing the stack...
This device needs to be on a supported backend. Usually that means plugged into a blue/USB 3.0 port!
Bailing out.

Does that mean I can't inject paylolads without a usb 3.0 port?

tzechco avatar Jul 21 '19 02:07 tzechco

Wow, that's no good. USB3 support in (FOSS) linux is non-existent.

MichaelMackus avatar Dec 19 '19 23:12 MichaelMackus

A sample udev rule that enables RW access to all users on the machine to switch based on VID:PID.

cat /etc/udev/rules.d/50-nintendo-switch.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", ATTR{idProduct}=="7321", MODE="0777"

Use sudo udevadm control --reload to reload the udev rule set and then reconnect the switch.

gustafj avatar Feb 05 '20 17:02 gustafj

@tykl4 I found out after some research you should be able to use USB2 if you patch your EHCI driver. Usually that means re-compiling your kernel, though. You'll also likely have to run fusee-launcher.py with the "--override-checks" argument. That being said, use this at your own risk since I'm not sure what side-effects running that patch may have - I'm not too familiar with kernel driver development but that check has to be in there for some reason.

MichaelMackus avatar May 10 '20 18:05 MichaelMackus