ufrisk / pcileech

Direct Memory Access (DMA) Attack Software
GNU Affero General Public License v3.0
4.87k stars 718 forks source link

USB3380 flashing failure #224

Closed m-1-k-3 closed 1 year ago

m-1-k-3 commented 1 year ago

Hello pcileech team,

Currently I'm trying to setup a USB3380 PCIe device with pcileech. As I'm running into issues it would be great if you could help me in identifying the root of this issue.

I'm using the following hardware:

The device is shown on my physical Kali Linux:

└─$ lspci        
02:00.0 USB controller: PLX Technology, Inc. Device 3380 (rev ab)                                                                                                                                                                                                                           

02:00.0 USB controller: PLX Technology, Inc. Device 3380 (rev ab) (prog-if fe [USB Device])
        Subsystem: PLX Technology, Inc. Device 3380
        Flags: bus master, fast devsel, latency 0, IRQ 138, IOMMU group 12
        Memory at b1128000 (32-bit, non-prefetchable) [virtual] [size=8K]
        Memory at b1110000 (32-bit, non-prefetchable) [virtual] [size=64K]
        Memory at b1100000 (32-bit, non-prefetchable) [virtual] [size=64K]
        Expansion ROM at b1120000 [virtual] [disabled] [size=32K]
        Capabilities: <access denied>
        Kernel driver in use: net2280
        Kernel modules: net2280

I tried the following:

sudo rmmod net2280
[  216.890997] net2280 0000:02:00.0: unbind

sudo insmod pcileech_flash.ko
[  229.265376] pcileech_flash: loading out-of-tree module taints kernel.
[  229.265918] PCILEECH FLASH: Module init called.
[  229.265932] PCILEECH FLASH: Found USB3380 not flashed as PCILeech.
[  229.266224] PCILEECH FLASH: ERROR: Firmware write/verify not successful. Error: fffffffe

sudo insmod pcileech_flash.ko [ 264.500651] PCILEECH FLASH: Module init called. [ 264.500656] PCILEECH FLASH: Found USB3380 not flashed as PCILeech. [ 264.500665] net2280 0000:02:00.0: BAR 0: can't reserve [mem 0xb1128000-0xb1129fff] [ 264.500666] PCILEECH FLASH: ERROR: Cannot request regions. [ 264.500668] Trying to free nonexistent resource <00000000b1110000-00000000b111ffff> [ 264.500669] Trying to free nonexistent resource <00000000b1100000-00000000b110ffff>

ufrisk commented 1 year ago

I'm not exactly sure what the issue is. The net2280 must be unloaded but you already did this.

I have had reports in the past about flashing the usb3380 failing on more recent kernels due to some changes they made. If you try to flash it on something older, such as ubuntu 18.04 will it work? (I should look into this more, but very few use the usb3380 nowdays since the project is mostly migrated to fpga hardware, but it's still supported so I guess I should take another look at the flashing program). But please let me know if ubuntu 18.04 (or older) will work.

m-1-k-3 commented 1 year ago

Thank you @ufrisk. I will try to set up the Ubuntu next day. Which device would be an alternative to the USB3380 for mini PCIe?

m-1-k-3 commented 1 year ago

@ufrisk thank you for the note regarding Ubuntu 18.04. The module load was good and a blue led appeared now. Also the kernel messages indicate a successful flashing process.

ufrisk commented 1 year ago

Awesome, and thanks for letting me know :)

If you'd wish to go down the FPGA route and target mini pcie it's not possible directly, but there are adapters.

Something like this will work https://www.aliexpress.com/item/33031239652.html Note that you'd need to power the PCIe board with 12V (this is done from the SATA connector).

Supported FPGA boards are listed here: https://github.com/ufrisk/pcileech-fpga In your case the PCIe Squirrel from LambdaConcept is probably the best option.

But it's not as a nice form factor as the USB3380, but it will be a lot more capable hardware wise. But if you're in luck the USB3380 may be enough for your requirements.

m-1-k-3 commented 1 year ago

Thank you for all the details. Currently I will try to move on with the USB3380 and in the mean time I will find a good setup for upcoming tasks. The MiniIPCe to PCIe adapter board looks very interesting.