Skip to content

Getting Started

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.

Hak5 Ducky Script

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 - Z
  • 0 - 9
  • F1 - F12

Modifier keys:

  • ALT
  • CTRL
  • DELETE
  • WINDOWS or GUI

Other keys:

  • ENTER
  • ESC
  • SPACE
  • DELETE
  • UP, DOWN, LEFT, RIGHT
Function ExampleExplaination
REM This is a commentAdds a comment
DELAY 1000Pause for 1000 milliseconds
STRING Hello WorldType text
REPEAT 4Repeat the previous command 4 times

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.

Syntax Rules

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!