USB Rubber Ducky

From Embedded Lab Vienna for IoT & Security
Jump to: navigation, search


This documentation is about the USB Rubber Ducky a well-known preprogrammable keyboard.


  • This device is operating system independent but you will need a pc with an internet connection and a USB A port.


Disclaimer: This device is only for testing purposes and to raise awareness of Exploits. Don’t use this device to exploit people or their hardware!


The Rubber Ducky is a powerful device that looks like a usual USB Stick and is well-known by Penetration testers. The Device gets recognized as a keyboard by your computer and works like on. Furthermore, it types a preprogrammed code that exploits your computer. The use cases go from a harmless shutdown or windows lock prank to a very harmful backdoor opener or keyboard logger. The device can Type more than 1000 word per minute and surpasses any human. It is even possible to install python scripts on the users computer.

Package Content

If you purchase the USB Rubber Ducky form Hak5 you will find this content:

  • USB Rubber Ducky
  • 128 MB micro SD Card
  • The casing of the USB Rubber Ducky
  • USB micro SD Card reader
  • USB A female to micro USB male adapter
  • USB Rubber Ducky field guide

The USB micro SD Card reader to transfer the encoded the program onto the micro SD Card.

The USB A female to micro USB male adapter allows to use the USB Rubber Ducky on mobile devices.

Attack Workflow


During the Research process pick a target and gather following information:

  • What device uses the target
  • That operating system has the target device
  • What keyboard configuration has the target device
  • Has the victim some interesting Software
  • What are the vulnerabilities of the operating system or software.
  • What privileges has an usual user on this device


  • Write the ducky script specific for the target device.

The USB Rubber Ducky uses its own language which is easy to understand but keep in mind the short cut key combinations are operating system dependent.

The ducky script is explained below.


  • Encode the ducky script with a ducky script encoder

There is and Online Encoder IDE which can be found on

Test and Optimize

  • Test and optimize your script for perfect typing speeds.


  • Deploy the encoded script on the USB Rubber Ducky by Pasting the inject.bin file onto the micro SD Card.
  • Use the USB Rubber Ducky and watch it type

Used Hardware

Device to be used with this documentation Maybe another device to be used with this documentation