A simple rubber ducky program using arduino leonardo
A simple Rubber Ducky DuckyScript interpreter for Arduino Leonardo.
Write your DuckyScript in C array, upload to your Leonardo, and plug it into any computer to automatically execute keyboard commands (HID)!
- Write DuckyScript as
const char* script[]directly in code - Supports
DELAY,STRING,ENTER,TAB,GUI,CONTROL,SHIFT,ALT, arrow keys, function keys (F1~F12), and more - No EEPROM/SD card required
- Plug and play (auto run on power up or reset)
- Easy to modify, fast to test
Edit the script array in your Arduino sketch.
Each array element is a line of DuckyScript.
Example:
const char* script[] = {
"GUI r",
"DELAY 500",
"STRING cmd",
"DELAY 200",
"ENTER",
"DELAY 700",
"STRING start https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"ENTER"
};-
Open the
.inofile in Arduino IDE -
Select Board:
Arduino Leonardoor other arduino that support HID. -
Plug your Leonardo into your computer via USB
-
Click Upload
-
After upload, unplug and re-plug Leonardo into a Windows PC (or press the RESET button).
-
The script will run automatically, emulating a keyboard and executing your commands.
-
REM- Comment line (ignored) -
DELAY <ms>- Wait specified milliseconds (e.g.DELAY 500) -
STRING <text>- Type text string (e.g.STRING notepad) -
ENTER- Press Enter key -
TAB- Press Tab key -
GUI <key>- Press Windows key + key (e.g.GUI r) -
CONTROL <key>- Press Ctrl + key -
SHIFT <key>- Press Shift + key -
ALT <key>- Press Alt + key -
ESCAPE,CAPSLOCK,DELETE,BACKSPACE,MENU -
UP,DOWN,LEFT,RIGHT- Arrow keys -
F1~F12- Function keys