Skip to main content

What is PayloadStudio

PayloadStudio is the official development environment for writing USB Rubber Ducky payloads. Built by Hak5, it gives you everything you need to write, test, and compile DuckyScript code - all from your web browser.

Syntax highlighting

DuckyScript commands are color-coded so you can quickly distinguish between comments, delays, key presses, and string inputs.

Error checking

PayloadStudio PRO highlights errors in your code before you compile - catching mistakes that would cause your payload to fail on the device.

Auto-complete

Start typing a DuckyScript command and PayloadStudio suggests completions, helping you learn the language as you write.

One-click compile

Click “Generate Payload” and PayloadStudio compiles your DuckyScript into an inject.bin file ready to load onto the Rubber Ducky.
PayloadStudio runs entirely in your browser at payloadstudio.hak5.org - no installation required. The Community Edition is free and handles basic payloads. PayloadStudio PRO unlocks live error checking, advanced compiler optimizations, and debugging tools.
Each of you has been assigned a PayloadStudio PRO license for this camp. PRO gives you real-time error feedback as you type, which makes learning DuckyScript much easier.

Setting up PayloadStudio PRO

Follow these steps to activate your PRO license and get ready to write payloads.
1

Open PayloadStudio

Go to payloadstudio.hak5.org in your web browser. Chrome, Edge, or Firefox all work.
2

Navigate to license activation

Look for the Pro or License area in the PayloadStudio interface. Click on it to open the license activation panel.
3

Enter your credentials

Enter the email address and license key assigned to you from the table below. Every license uses the same email address - only the license key is different per student.
4

Confirm activation

After entering your credentials, PayloadStudio PRO should activate. You will see PRO features enabled, including live error checking and advanced compiler options.

License key assignments

Find your name in the table below and use the corresponding license key. All licenses use the same email address.
All license keys use the email address pjadhwani@hotmail.com. Enter this email when prompted - not your personal email.
If you run into issues activating your license, ask your instructor for help. Make sure you’re using the email address from the table - pjadhwani@hotmail.com - not your own email.

DuckyScript quick reference

DuckyScript is the programming language you use to write Rubber Ducky payloads. Each command maps to a keyboard action - pressing keys, typing text, or waiting. Here are the commands you need for today’s exercises.

Text and execution

Timing

Timing is critical in DuckyScript. If you type a URL before the Run dialog is fully open, the keystrokes are lost. When in doubt, add more delay - you can always shorten it later.

Modifier keys

Toggle and special keys

LED control

The LED commands control the built-in indicator light on the Rubber Ducky. You can use them to give yourself visual feedback - for example, blink red while the payload runs and turn green when it’s done.

Combining modifier keys

You can combine modifier keys with other keys in a single line. The format is:
Common combinations:

Arming the Rubber Ducky

Once you’ve compiled a payload in PayloadStudio, you need to load it onto the Rubber Ducky. This is done in arming mode, where the device appears as a regular USB flash drive.
1

Plug in the USB Rubber Ducky

Insert the Rubber Ducky into a USB port on your computer.
2

Enter arming mode

The Rubber Ducky should appear as a removable drive labeled DUCKY in File Explorer (Windows) or Finder (Mac). If it doesn’t appear - or if it starts executing a previously loaded payload - press the push button on the device to switch to arming mode.
3

Open the DUCKY drive

Navigate to the DUCKY drive. You will see the existing inject.bin file (if one is loaded). There may also be other configuration files - leave those alone.
4

Replace inject.bin

Copy your newly compiled inject.bin file from PayloadStudio onto the DUCKY drive. If there’s an existing inject.bin, replace it. The Rubber Ducky always executes the inject.bin file in the root directory.
5

Safely eject the drive

Right-click the DUCKY drive and select Eject (or use “Safely Remove Hardware” on Windows). This ensures the file is fully written to the microSD card before you unplug.
6

Test the payload

Unplug the Rubber Ducky, wait a moment, then plug it back in. It will now execute your new payload in attack mode. Make sure you’re testing on your own computer.
Responsible use reminder: Only deploy payloads on computers you own or have explicit permission to test. Plugging a Rubber Ducky into someone else’s computer without permission is unauthorized access - a federal crime under the Computer Fraud and Abuse Act (CFAA), regardless of how harmless the payload seems.

Your first payload: Hello World

Before you move on to the RickRoll payload, try this minimal “Hello World” script to verify your setup is working.
This payload:
  1. Waits 1 second for the computer to recognize the device
  2. Opens the Run dialog with GUI r
  3. Waits half a second for the dialog to appear
  4. Types “notepad” and presses Enter to open Notepad
  5. Waits 1 second for Notepad to load
  6. Types “Hello from the USB Rubber Ducky!” into Notepad
If you see the message appear in Notepad, your Rubber Ducky is set up correctly and you’re ready for the RickRoll payload.
If the message appeared in Notepad, your PayloadStudio setup, compilation, and Rubber Ducky arming process are all working. You’re ready to move on to the real payload.