top of page
Search

DIY Rubber Ducky

  • Writer: infiniteloop
    infiniteloop
  • Dec 2, 2024
  • 2 min read

Ever wanted to create your own USB Rubber Ducky without breaking the bank? Using a Digispark ATtiny85, a compact Arduino-compatible device, you can create a simple keystroke injection tool for fun or educational purposes.

What is a USB Rubber Ducky?

A USB Rubber Ducky emulates a keyboard, sending pre-programmed keystrokes to a connected computer. These devices are popular for security testing since they can quickly execute scripts once plugged in.

Step-by-Step Guide

Install Digispark Drivers
  • Head to the Digispark GitHub repo.

  • Download and install Digistump.Drivers.zip for your operating system and then extract and run DPinst.exe (x86) or DPinst64.exe (x64) depending on your OS.


Set Up Arduino IDE
Write Your Rubber Ducky Script

With that done, you can now create a new Sketch by clicking File -> New Sketch

Below is a simple POC script you can use to open a Command Prompt and run two simple enumeration commands (whoami && hostname), of course, you can change it to whatever you want, based on your needs:

#include "DigiKeyboard.h"


void setup() {

}


void loop() {

  DigiKeyboard.sendKeyStroke(0);

  DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);

  DigiKeyboard.delay(500);

  DigiKeyboard.println("cmd");

  DigiKeyboard.delay(500);


  DigiKeyboard.println("whoami && hostname");

  DigiKeyboard.delay(500);


  while (true) {

    digitalWrite(0, HIGH);

    digitalWrite(1, HIGH);

    delay(300);

    digitalWrite(0, LOW);

    digitalWrite(1, LOW);

    delay(300);

  }

}

​​

Your code should look something like this when looking at your Arduino IDE:


Your upload and execution output should look something like this:

​In order to make sure everything works, you can test the code out by clicking the "Verify" (V) button on the top left, if everything is ok you should see an informational message that the test was completed successfully.

Upload the script to your DigiSpark using the "Upload" button (->), plug in your DigiSpark when prompted to, and you're good to go!

And that’s it! You’ve just turned a simple DigiSpark into a powerful USB Rubber Ducky, capable of executing custom scripts with just a plug. Whether you're testing security setups or automating tasks, this project opens the door to endless possibilities. Keep experimenting, learn from each build, and who knows? maybe your next idea will push the boundaries even further! Stay curious, stay safe, and most importantly, have fun!​​​​​​​​​


 
 
 

Recent Posts

See All
Cloudy With a Chance of Backdoors

Introduction You know the saying, "Keep your friends close, and your enemies closer." The same principle applies here. Collaboration with...

 
 
 
RoleCrawl

RoleCrawl is a PowerShell tool I designed to audit User and Group role assignments in Azure, covering both subscription and resource...

 
 
 

Comments


bottom of page