Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
The USB Rubber Ducky looks like a memory stick but announces itself as a keyboard, typing a prepared script into an unlocked computer faster than any person could.

What Is the USB Rubber Ducky?
The USB Rubber Ducky exploits a trust decision that every operating system made decades ago: keyboards do not need approval. Plug one in and it works immediately, because asking a user to authorise their keyboard with the keyboard would be absurd. The Rubber Ducky, sold by Hak5, is a device shaped like a memory stick that tells the computer it is a keyboard and then types.
What it types is a script loaded onto a microSD card, and it types it at machine speed. Several hundred characters go in before a user watching the screen has worked out what is happening, which is enough to open a terminal, run a command, and close the window again.
The device enumerates as a USB human interface device. The operating system loads a standard keyboard driver, the device begins sending key codes from its payload, and the computer obeys, because from its point of view somebody is typing. No vulnerability is exploited and no software is installed, which is why antivirus products historically saw nothing at all.
Payloads are written in DuckyScript, a deliberately simple language of delays, key names, and strings. Later versions added variables, conditional logic, and the ability to read back the state of the keyboard lock indicators, which gives the device a primitive return channel: the host can be made to toggle those lights in a pattern that encodes data, so the device can exfiltrate small amounts of information without any network access at all. The same versions can fingerprint the operating system before choosing which payload to run.
| Device | Distinguishing feature |
|---|---|
| USB Rubber Ducky | Dedicated keystroke injection, memory stick form factor |
| Bash Bunny | Multiple payload modes, can also present as storage or a network adapter |
| O.MG Cable | Injection hardware hidden inside an ordinary charging cable, with wireless control |
| Flipper Zero | Multi-tool that includes keystroke injection alongside radio and NFC features |
| Programmable microcontrollers | Inexpensive boards flashed with HID firmware, functionally equivalent |
The last row is the one that matters for policy. The capability costs a few pounds, so controls based on identifying one specific product are pointless. The underlying issue is covered more broadly under BadUSB.
Physical entry and keystroke injection pair naturally. A tester who has reached a desk during a physical penetration test needs seconds at an unlocked machine, and the device provides them. The second scenario is the drop: devices left in a car park, a reception area, or an internal post tray, relying on somebody plugging one in to see what is on it. That behaviour is measured in awareness exercises precisely because it remains common.
What a payload is permitted to do belongs in the rules of engagement. In a controlled test it typically proves execution and stops, rather than establishing a persistent channel on a production endpoint.
Three layers work together.
Physical measures still have a place. Port blockers on machines in public areas, charge-only adapters for staff who need to power devices from unfamiliar sockets, and a clear instruction never to plug in a found drive all reduce exposure. The instruction works better when people have been told why.
Our Social Engineering Services include device drop scenarios and on-site injection attempts, which test the lock-screen habit and the device policy at the same time.
Not by itself. The device delivers keystrokes rather than files, so nothing malicious is written to disk for a scanner to inspect. Modern endpoint products do detect what the keystrokes cause: an unexpected script interpreter launching, an encoded command line, or an outbound connection. Device control and screen locking remain the primary preventive controls.
No, not for keystroke injection. A locked screen accepts nothing but the password, so the payload goes nowhere. This is why the automatic lock timeout is the single most valuable control against the technique. Devices that also present as network adapters can attempt other attacks against a locked machine, which is a separate concern.
Use device control policy. Windows Group Policy can restrict device installation to approved hardware identifiers, so an unrecognised keyboard is never initialised. Endpoint protection suites add auditing and alerting, and USBGuard provides equivalent control on Linux. Combine this with short screen lock timeouts and logging of new HID devices for investigation.
Yes. It is sold openly as security testing equipment and is used by testers, researchers, and automation engineers. Using it against a computer you have no authority over is unauthorised access under the Computer Misuse Act 1990, and carrying it with that intent can engage other offences. Authorised testing requires written permission naming the systems and sites involved.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.