explaingit

hak5/usbrubberducky-payloads

5,722PowerShellAudience · ops devopsComplexity · 2/5Setup · moderate

TLDR

The official script collection for the USB Rubber Ducky, a hardware device that emulates a keyboard to automate keystroke sequences on any computer for security testing and IT automation.

Mindmap

mindmap
  root((usbrubberducky-payloads))
    What it does
      Emulate keyboard input
      Automate keystrokes
      Run payload scripts
    Payload categories
      Credential gathering
      Remote access
      IT automation
      Pranks
    Tech stack
      DuckyScript 3.0
      PayloadStudio
      PowerShell
    Use cases
      Penetration testing
      Security demos
      Sysadmin tasks
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Demonstrate what an attacker with brief physical access to a computer could accomplish during an authorized penetration test.

USE CASE 2

Automate repetitive IT administration tasks across many machines by scripting keyboard sequences.

USE CASE 3

Run community-contributed credential gathering or remote access payloads against test systems in an authorized environment.

Tech stack

DuckyScriptPowerShellPayloadStudio

Getting it running

Difficulty · moderate Time to first run · 30min

Payloads must be compiled with Hak5 PayloadStudio before loading onto the physical USB Rubber Ducky hardware device.

License terms not mentioned, Hak5 advises reviewing the legal section before use and using only for authorized testing.

In plain English

This is the official collection of scripts for the USB Rubber Ducky, a physical hardware tool sold by Hak5. The device looks like an ordinary USB flash drive, but when plugged into a computer it identifies itself as a keyboard rather than a storage device. Computers automatically trust keyboards, so the device can type keystrokes into the target machine at speeds far beyond what a human could manage. The scripts in this repository are called payloads, and each one instructs the device to perform a specific sequence of keyboard actions: opening a terminal, running a command, changing a system setting, and so on. Uses range from legitimate IT automation tasks (the kind of repetitive work a sysadmin might do across many machines) to security testing and penetration testing, where a tester needs to demonstrate what an attacker with brief physical access to a computer could accomplish. Payloads are written in DuckyScript, a simple language created specifically for the Rubber Ducky. The 2022 version of the device introduced DuckyScript 3.0, which added loops, conditional logic, and functions, making it far more capable than the original three-command version from 2010. Payloads must be compiled using Hak5's PayloadStudio tool before being loaded onto the device. The repository is community-driven: anyone can submit a new payload or improve an existing one via a pull request. Payloads are organized into categories covering areas like credential gathering, remote access, system administration, and pranks. The README links to documentation, a quick-start guide, a Discord server, and Hak5's commercial PayloadStudio editor. Hak5 notes that it does not guarantee payload functionality and advises users to review the legal section before use. The device and the payloads in this repository are intended for authorized security testing and educational purposes.

Copy-paste prompts

Prompt 1
I have a USB Rubber Ducky and want to write a DuckyScript 3.0 payload that opens a terminal and runs a specific PowerShell command on Windows. Show me the syntax including how to use delays.
Prompt 2
Help me find and adapt a payload from the hak5/usbrubberducky-payloads repo that demonstrates what an attacker could do with 60 seconds of physical access to a locked Windows machine.
Prompt 3
What DuckyScript 3.0 commands let me add conditional logic so my payload behaves differently depending on whether it detects a Windows or macOS machine?
Prompt 4
Show me how to compile a DuckyScript payload using PayloadStudio and load it onto the USB Rubber Ducky so it runs on plug-in.
Open on GitHub → Explain another repo

← hak5 on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.