Getting Started
Ducky Script
Section titled “Ducky Script”With the USB Rubber Ducky release, Hak5 also introduced Ducky Script to make programming easy and fun. Today, we have many more BadUSB tools available, and many of them built upon Ducky Script by adding additional features. I call these implementations BadUSB Script to clarify that this isn’t limited to Hak5 products. The BadUSB Script we will learn here is compatible with Ducky Script and, therefore, with most BadUSB tools.

Pressing keys is as easy as saying the name of the key, like WINDOWS to press the windows key - or GUI as a shorter alternative.
Pressing multiple keys can be achieved like this: CTRL ALT DELETE
Available are keys:
a-Z0-9F1-F12
Modifier keys:
ALTCTRLDELETEWINDOWSorGUI
Other keys:
ENTERESCSPACEDELETEUP,DOWN,LEFT,RIGHT
Functions
Section titled “Functions”| Function Example | Explaination |
|---|---|
REM This is a comment | Adds a comment |
DELAY 1000 | Pause for 1000 milliseconds |
STRING Hello World | Type text |
REPEAT 4 | Repeat the previous command 4 times |
Syntax
Section titled “Syntax”A BadUSB Script is nothing more than a text file that is interpreted line by line. Each line contains a function or a combination of keys. A single space is used as a separator.

Documentation ⚠️
Section titled “Documentation ⚠️”What I’ve shown you in this lesson is just an overview. Most tools offer additional keys or features. Some might have a completely different scripting language, so it’s crucial you have a look at the documentation of your BadUSB!
- Duckify: https://duckify.spacehuhn.com/docs/about
- WiFi Duck: docs.spacehuhn.com
- Malduino: http://docs.maltronics.com
- Hak5: http://docs.hak5.org