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.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.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
Navigation 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: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.
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.- Waits 1 second for the computer to recognize the device
- Opens the Run dialog with
GUI r - Waits half a second for the dialog to appear
- Types “notepad” and presses Enter to open Notepad
- Waits 1 second for Notepad to load
- Types “Hello from the USB Rubber Ducky!” into Notepad
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.

