checkra1n / BugTracker

checkra1n bug tracker
720 stars 108 forks source link

Run checkra1n without root, udev rules does not work #2176

Open onny opened 2 years ago

onny commented 2 years ago

Hey, I want to know if it is possible to run checkra1n without root permissions. I tried to add udev rules:

SUBSYSTEM=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="4141", GROUP="users", MODE="0660"
SUBSYSTEM=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="1227", GROUP="users", MODE="0660"

It looks promising but fails in the end:

checkra1n -vcpE
#
# Checkra1n beta 0.12.4
[...]
 - [09/03/21 10:42:26] <Info>: Waiting for DFU devices
 - [09/03/21 10:42:26] <Verbose>: DFU device connected: 16014e300a2d26
 - [09/03/21 10:42:26] <Info>: Exploiting
 - [09/03/21 10:42:26] <Verbose>: Attempting to perform checkm8 on 8010 11...
 - [09/03/21 10:42:26] <Info>: Checking if device is ready
 - [09/03/21 10:42:26] <Verbose>: == Checkm8 Preparation stage ==
 - [09/03/21 10:42:27] <Info>: Setting up the exploit (this is the heap spray)
 - [09/03/21 10:42:27] <Verbose>: == Checkm8 Setup stage ==
 - [09/03/21 10:42:27] <Verbose>: Disabled probabilistic mode since we encountered a partial xfer
 - [09/03/21 10:42:27] <Verbose>: Deterministic approach was successful!
 - [09/03/21 10:42:27] <Info>: Right before trigger (this is the real bug setup)
 - [09/03/21 10:42:27] <Verbose>: Entered initial checkm8 state after 0 steps, issuing DFU abort..
 - [09/03/21 10:42:28] <Error>: Couldn't open USB interface due to EACCES. Run as root maybe? (error code: -75)

dmesg output:

[34747.353409] usb 1-1.2: New USB device found, idVendor=05ac, idProduct=1227, bcdDevice= 0.00
[34747.353423] usb 1-1.2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[34747.353425] usb 1-1.2: Product: Apple Mobile Device (DFU Mode)
[34747.353426] usb 1-1.2: Manufacturer: Apple Inc.
[34747.353427] usb 1-1.2: SerialNumber: CPID:8010 CPRV:11 CPFM:03 SCEP:01 BDID:0E ECID:0016014E300A2D26 IBFL:3C SRTG:[iBoot-2696.0.0.1.33]

[34774.407637] apple-mfi-fastcharge 1-1.2: usbfs: USBDEVFS_CONTROL failed cmd checkra1n rqt 128 rq 6 len 192 ret -110
[34774.421637] apple-mfi-fastcharge 1-1.2: usbfs: USBDEVFS_CONTROL failed cmd checkra1n rqt 128 rq 6 len 193 ret -110
[34774.435652] apple-mfi-fastcharge 1-1.2: usbfs: USBDEVFS_CONTROL failed cmd checkra1n rqt 128 rq 6 len 193 ret -110
[34774.449613] apple-mfi-fastcharge 1-1.2: usbfs: USBDEVFS_CONTROL failed cmd checkra1n rqt 128 rq 6 len 193 ret -110
[...]
[34776.005576] apple-mfi-fastcharge 1-1.2: reset high-speed USB device number 100 using ehci-pci
[34776.084645] apple-mfi-fastcharge 1-1.2: usbfs: process 134812 (checkra1n) did not claim interface 0 before use
[34777.414132] apple-mfi-fastcharge 1-1.2: USB disconnect, device number 100
[34777.666212] usb 1-1.2: New USB device found, idVendor=05ac, idProduct=1227, bcdDevice= 0.00
[34777.666219] usb 1-1.2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[34777.666223] usb 1-1.2: Product: Apple Mobile Device (DFU Mode)
[34777.666226] usb 1-1.2: Manufacturer: Apple Inc.
[34777.666228] usb 1-1.2: SerialNumber: CPID:8010 CPRV:11 CPFM:03 SCEP:01 BDID:0E ECID:0016014E300A2D26 IBFL:3C SRTG:[iBoot-2696.0.0.1.33]

I'm trying to integrate this into postmarketOS flasher to simplify the process to get Linux running on the iPhone 7: https://gitlab.com/postmarketOS/pmbootstrap/-/merge_requests/2098 Usually the postmarketOS scripts don't require root access for flashing, so I would like to avoid it as well.

Regards Jonas