Keystroke injection via USB

ATtiny 85 microcontroller

Environment setup on Kali and “Hello World”
  1. Download the Arduino IDE and install the dependecies
sudo apt-get install libusb-0.1-4
  1. Extract and install -

  2. Go to Preferences > Additional Boards Manager URLs and paste “"

  3. Go to Tools > Board > Board Manager and search for “Digistump AVR” and install the latest version.

  4. Hello world

    #include "DigiKeyboard.h"
    void setup() {
    void loop() {
    DigiKeyboard.print("Hello World");
    for(;;){ /*empty*/ }
  5. Click on Upload button and plug the USB device

Change the product ID (PID) and the vendor ID (VID)
  1. Check the VID:PID

  2. Edit the configuration file (example 06ab:0107)

    nano /root/.arduino15/packages/digistump/hardware/avr/1.6.7/libraries/DigisparkKeyboard/usbconfig.h
    #define USB_CFG_VENDOR_ID 0xab, 0x06
    #define USB_CFG_DEVICE_ID 0x07, 0x01

Rubber Ducky

  1. Setup

    cd /opt
    git clone
    cd USB-Rubber-Ducky/
  2. Hello World

    REM Hello World
    DELAY 1000
    STRING Hello world
  3. Loading the script

    java -jar duckencoder.jar  -i /path/to/hello_world.duckyscript -o /media/root/A87B-A154/inject.bin
  4. Unplug the device

    umount /media/root/A87B-A154