Join our Newsletter — 33% off our NHI Course

USB Rubber Ducky

A USB Rubber Ducky is a malicious USB device that pretends to be a keyboard and types attacker-controlled commands at high speed. It is used for rapid initial compromise, credential theft, or payload delivery. Defenders reduce the risk by controlling USB device use, blocking untrusted human interface devices, and monitoring for unexpected keystroke-driven activity.

How a USB Rubber Ducky works

A USB Rubber Ducky abuses the trusted keyboard interface. Because the operating system sees it as a human input device, it can inject keystrokes much faster than a person, often before users realise anything unusual is happening.

The danger is not the plastic device itself, but the authority granted to keyboard input. A short sequence can open shells, change settings, download payloads, or invoke built-in administration tools that already exist on the target system.

Why it is effective for initial compromise

This attack works well when physical access is possible, even briefly. A device left in a meeting room, lobby, or shared workspace can be enough to trigger command execution if the endpoint accepts new USB HID devices without restriction.

The technique is especially useful for rapid hands-on-keyboard abuse because it can compress what would normally take several manual steps into a scripted burst. That makes it attractive for opportunistic intrusion, post-exploitation staging, and quick credential capture.

What defenders should verify on endpoints

Defenders should understand which systems accept unknown USB keyboards, which ports are enabled, and whether endpoint controls can distinguish approved peripherals from untrusted HID devices. Device inventory alone is not enough if the environment still trusts any new keyboard it sees.

Monitoring matters as much as prevention. Unexpected logon attempts, unusual shell launches, sudden registry or policy changes, and high-speed input bursts are all signs that a HID injection attempt may have succeeded or at least been attempted.

How organisations reduce the attack surface

Hardening starts with controlling where and when USB devices are permitted. Many teams use port restrictions, device allowlisting, endpoint policy enforcement, and user education together, because no single measure fully removes the risk of malicious keystroke injection.

When physical access cannot be tightly controlled, compensating controls should make the payload less useful. Least privilege, strong authentication, script restriction, application control, and alerting on suspicious administrative activity all reduce the value of a successful USB-based attack.

Risk and Threat Considerations

A USB Rubber Ducky is dangerous because it turns a short physical foothold into trusted input. If the device lands on an unlocked workstation or an endpoint that accepts new HID peripherals freely, an attacker can move from access to execution very quickly.

Failure mechanism: The host treats the device as a legitimate keyboard, so the attacker can inject commands at machine speed before normal user review or security tooling can intervene.

Impact: The result can be immediate compromise, including malicious configuration changes, payload execution, credential capture, or the launch of follow-on activity that is harder to attribute than direct interactive use.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK addresses the attack and risk surface, while NIST SP 800-53 Rev 5, CIS Controls v8, NIST CSF 2.0 and OWASP ASVS set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
NIST SP 800-53 Rev 5 IA-3 — Device Identification and Authentication Device authentication is central to trusting attached USB peripherals.
AC-19 — Access Control for Mobile Devices Controls removable-device use and interaction paths that enable malicious USB input.
SI-4 — System Monitoring Unexpected keystroke injection is detected through monitoring for anomalous endpoint behavior.
Recommendation — Require device authentication or approval before endpoints trust new attached HID peripherals. Restrict removable device use and enforce policy for externally attached peripherals. Monitor endpoints for suspicious input-driven activity and alert on abnormal administrative actions.
CIS Controls v8 CIS-10 — Malware Defenses Malicious USB devices are a delivery mechanism for payloads and scripted abuse.
CIS-9 — Email and Web Browser Protections The broader control set supports endpoint hardening against common initial-access paths.
Recommendation — Use malware defenses to detect or block payload delivery triggered through removable media. Harden user workstations and restrict risky execution paths that payloads may exploit.
NIST CSF 2.0 PR.AA-01 — Identities and Credentials are Issued, Managed, Verified, Revoked, and Audited The attack often aims to steal or abuse credentials after initial execution.
DE.CM-03 — Personnel Activity is Monitored Unexpected human-input-like activity can surface in detection telemetry.
Recommendation — Verify and audit credential issuance and revocation to limit the value of a successful injection attack. Correlate endpoint activity with suspicious user-action patterns to spot covert keystroke injection.
OWASP ASVS V16 — Security Logging and Error Handling Unexpected command execution should be observable in application and host logs.
Recommendation — Log sensitive administrative actions so injected commands are easier to detect and investigate.
MITRE ATT&CK T1056.001 — Keylogging USB Rubber Ducky-style keystroke injection is a trusted-input abuse pattern related to keyboard interaction.
Recommendation — Map endpoint detections to keyboard-interaction abuse and hunt for scripted input bursts.

Practitioner Guidance

What to watch for: Treat any workflow that depends on unrestricted USB input as a governance decision, not a convenience setting. If your environment relies on shared desks, public spaces, or temporary contractor access, the question is not whether a malicious HID can be used, but whether the endpoint estate is prepared for it.

Practitioner takeaway: The strongest defence is not a single block rule, it is reducing trust in unknown peripherals while making suspicious keystroke-driven activity visible quickly.