DIY USB Rubber Ducky with Raspberry Pi Pico
Overview
This project demonstrates how to create a USB Rubber Ducky using a Raspberry Pi Pico as a keyboard HID (Human Interface Device). The device can execute custom scripts for penetration testing, automating tasks, and ethical hacking. It supports French (FR) and US keyboard layouts, along with a custom scripting syntax.
Features:
- Raspberry Pi Pico as a USB HID Keyboard
- Custom scripting engine for executing payloads
- Support for multiple keyboard layouts (FR, US)
- Python-based execution engine
- Adafruit HID library support
Hardware Requirements
- Raspberry Pi Pico
- USB cable
- Computer for writing and running scripts
Device Image
Software Implementation
1. Setting Up the Raspberry Pi Pico
- Download and install MicroPython firmware on your Raspberry Pi Pico.
- Use Thonny IDE or another Python editor to upload scripts.
- Install Adafruit HID library to handle keyboard emulation.
2. Writing Payloads
The scripting syntax allows you to define keystrokes, delays, and commands, similar to traditional USB Rubber Ducky payloads. Example syntax:
1
2
3
WAIT 1000
WRITE Hello, World!
ENTER
3. Executing the Script
- Write the payload script.
- Upload it to the Raspberry Pi Pico.
- Plug the device into a target machine, and it will execute the keystrokes automatically.
Demonstration Video
📹 Watch the project in action: YouTube Short
Conclusion
This project showcases how the Raspberry Pi Pico can be repurposed as a USB Rubber Ducky, enabling penetration testers and cybersecurity enthusiasts to create and test payloads. Future enhancements could include GUI-based script generators, payload encryption, and multi-platform support.
Author
HAMZAOUI