No BS guide for creating BadUSB devices using:
- Raspberry Pi Pico (RP2040)
- Arduino Micro (ATmega32U4)
-
Connect the Pico to your computer - it will mount as a USB drive labeled
RPI-RP2
-
Install CircuitPython:
- Download CircuitPython firmware
- Copy the
.uf2
file to the root ofRPI-RP2
- The device will automatically reboot and remount as
CIRCUITPY
-
Install required libraries:
- Copy all files from
pico/*
in this repository toCIRCUITPY
- This includes HID libraries and a DuckyScript interpreter
source: dbisu/pico-ducky
3.1. For Pico-W only:
- Copy
pico-w/*
toCIRCUITPY
- This is just
secret.py
which contains the WiFi SSID and password
- Copy all files from
-
Add payload:
- Create a file named
payload.dd
containing your DuckyScript and copy it to the root ofCIRCUITPY
- Warning: If not in setup mode, the payload will run immediately
- Sample payloads are available in
payloads/ducky/
, compatible with Windows and MacOS
- Create a file named
Setup Mode
- Prevents automatic payload execution
- Bridge Pin 1 (
GP0
) to Pin 3 (GND
)
Stealth Mode
- Prevents the Pico from appearing as a USB storage device
- Bridge Pin 20 (
GP15
) to Pin 18 (GND
)
The Pico can store multiple payloads. The payload executed depends on which GPIO pins are grounded.
- Pin 6
GP4
(default) ->payload.dd
- Pin 7
GP5
->payload2.dd
- Pin 14
GP10
->payload3.dd
- Pin 15
GP11
->payload4.dd
-
Install development environment:
- Download and install Arduino IDE
- Connect the Micro and select it as the target board in IDE
-
Install HID library using either method:
- Option A: Download HID-Project and add via
Sketch -> Include Library -> Add .ZIP Library
- Option B: Use Arduino IDE's Library Manager, search for "HID-Project" and install
- Option A: Download HID-Project and add via
-
Deploy payloads:
- Convert DuckyScript to Arduino code using Duckuino
- Copy the generated code to a new sketch in the IDE
- Select
Sketch -> Upload
to flash the device - Sample payloads are available in
payloads/arduino/
, compatible with Windows and MacOS
- Add video/gif demos
- Add more payloads, add Linux variants
- Update Arduino sketches to fullscreen and increase font size
- Add Pico2