S5L8940X/S5L8942X/S5L8945X 的 checkm8 端口
checkm8 port for S5L8940X/S5L8942X/S5L8945X based on Arduino and MAX3421E-based USB Host Shield
Follow the instructions here. Note that the patch for USB Host Library Rev. 2.0 is different.
cd path/to/Arduino/libraries
git clone https://github.com/felis/USB_Host_Shield_2.0
cd USB_Host_Shield_2.0
git checkout cd87628af4a693eeafe1bf04486cf86ba01d29b8
git apply path/to/usb_host_library.patchBefore using the exploit change this line in the beginning of checkm8-a5.ino with target SoC CPID:
#define A5_8942This article may be helpful for better understanding.
HOST2DEVICE control request without data phase processingIn newer SoCs this request is processed as follows. Note that there are different cases for request_handler_ret == 0 and request_handler_ret > 0:
…But in our target SoCs this request is processed slightly different:
…So, if we send any HOST2DEVICE control request without data phase, then ep0_data_phase_length will be reset to zero. Because of this we can't use ctrlReq(0x21,4,0) to reenter DFU. But there is another way to reenter DFU:
ctrlReq(bmRequestType = 0x21,bRequest = 1,wLength = 0x40) with any datactrlReq(0x21,1,0)ctrlReq(0xa1,3,1)ctrlReq(0xa1,3,1)USB bus resetSo, to be able to write to the freed io_buffer, we do steps 1-4, then send an incomplete HOST2DEVICE control transaction to set global state, then trigger bus reset. This algorithm is fully described here by littlelailo.
But, if we use any normal OS with default USB stack for exploitation, then we can't avoid standard device requests (e.g. SET_ADDRESS, see this for more info) sent by OS before we can work with device. Because of it in our PoC we use Arduino and MAX3421E to control early initialization of USB.
In newer SoCs data packets are processed as follows. Note that in case of zero length packet processing is not performed.
…But in our target SoCs zero length packets are processed in the same way as non-zero length packets.
…As in the previous case, if we use normal OS with default USB stack, we can't avoid sending of zero length packets in status phase of standard device USB controll requests.
This project is licensed under the MIT License - see the LICENSE file for details
暂无开放 Issues,或尚未同步最近议题。