Using Flipper Zero as a USB Rubber Ducky (BadUSB)
flipper zerobadusbhidusbautomation
BadUSB lets Flipper emulate a USB keyboard and type payloads automatically. Same concept as the Hak5 Rubber Ducky — plug in, scripts run.
How It Works
When plugged into a computer, Flipper identifies as a USB HID keyboard. It then executes DuckyScript — a simple scripting language that types keystrokes, holds modifiers, and runs commands.
Writing a Basic Script
Scripts are .txt files placed in badusb/ on the Flipper SD card.
DuckyScript Syntax
DELAY 1000 ; Wait 1000ms
GUI r ; Windows key + R (Run dialog)
DELAY 500
STRING notepad ; Type "notepad"
ENTER ; Press Enter
DELAY 1000
STRING Hello World ; Type in notepad
Key Names
| Key | DuckyScript |
|---|---|
| Windows key | GUI |
| Ctrl | CTRL |
| Alt | ALT |
| Shift | SHIFT |
| Enter | ENTER |
| Tab | TAB |
| Arrow keys | UP DOWN LEFT RIGHT |
| Delete | DELETE |
| Escape | ESC |
Loading a Script on Flipper
- Connect Flipper SD card to PC (or use qFlipper)
- Place
.txtscript inSD Card/badusb/ - On Flipper: BadUSB → select script → Run
- Plug Flipper into target computer
- Script runs when you press OK
Example: Open Terminal and Run Command (Windows)
DELAY 2000
GUI r
DELAY 500
STRING cmd
ENTER
DELAY 800
STRING ipconfig /all
ENTER
Example: Open Terminal (macOS)
DELAY 1000
GUI SPACE
DELAY 500
STRING Terminal
ENTER
DELAY 1000
STRING echo "Hello from Flipper"
ENTER
Tips
- Always add delays — scripts run faster than OS can respond. 500–1000ms after GUI operations.
- Test on your own machine first
- Keyboard layout matters — scripts written for US QWERTY may type wrong characters on other layouts. Flipper has layout files in
badusb/assets/layouts/ - Set correct layout in BadUSB settings before running
- Find community scripts at github.com/UberGuidoZ/Flipper in the badusb folder