n0xa / m5stick-nemo

M5 Stick C firmware for high-tech pranks
Other
673 stars 134 forks source link

Adding BadUSB with payloads and layouts #134

Open usg-ishimura opened 4 months ago

usg-ishimura commented 4 months ago

Created Bad USB functionality with tested layouts and payloads. Tried to build from source with arduino-cli, arduino IDE and docker and it seems to work. Not tested on M5StickC only M5Cardputer. I chose to use esp32 USB library so that it can be used in conjunction with WiFi AP to exfiltrate data (see the first payload).

n0xa commented 3 months ago

I need to test what you've built, but I'll probably request a fresh PR no matter what since you've got 40+ commits here.

I know 100% the StickC and StickC Plus do not support BadUSB at all. The ESP32S2 in the Cardputer does. I don't know if the StickCPlus2 can do it but I suspect not. You will need to use ifdef to lock this to the cardputer platform only at the very least. I'll try to test what you've got so far sometime this week but I'm still unpacking from the move and haven't set up my Arduino development laptop yet.

usg-ishimura commented 3 months ago

I squashed the commits on my own develop branch and added one last commit that generates Bad USB entry in main menu only if CARDPUTER is defined, I'll wait for feedback to open the new PR.

usg-ishimura commented 3 months ago

@n0xa any update on this PR?

n0xa commented 3 months ago

Sorry, it's been a crazy 2 months or so full of uncertainty and I've had to focus on work, construction at our new place, and family/medical things. Also, my main laptop that I do all of my ESP32 work on is stuck in some kind of upgrade dependency purgatory at the moment, so my toolchain for Arduino/M5Stack is kind of a mess as well. I'll try to compile and test this in the next few days.

usg-ishimura commented 3 months ago

ok, no rush for me, just wanted to check

n0xa commented 3 months ago

I'm trying it out this morning, but this fork will not compile cleanly on my M5Sticks. You'll have to further gate pretty much anything to do with USBHID using ifdefs so they only are included when CARDPUTER is defined.

usg-ishimura commented 2 months ago

Should be fixed now, I put all references to USBHID in ifdef CARDPUTER condition blocks on m5stick-nemo.ino and tried to compile for M5StickC, it's up to date on both my main and develop branch