This post shows you how to create a DIY Rubber Ducky for as little as £4 using a Beetle USB ATMEGA32U4, and follows on from my Raspberry Pi Rubber Ducky article posted last month.
All you need for this article is a Windows machine and a Beetle USB. The Beetle USB can be picked up for £4.49 from eBay and takes around 6 weeks to arrive. The reason I have gone for the Beetle USB rather than the usual ATMEGA32U4 is because it has built in USB, rather than needing an additional micro USB cable.
Step 1: Get all the necessary software
We’re going to be using David Gouveia‘s excellent rubberduino script to convert the existing Rubber Ducky scripts into something our Beetle can understand, then the Arduino IDE to upload our converted payloads to the Beetle.
First step is to get the Arduino environment set up:
- Head over to the Arduino site and download the Windows IDE
- Install the IDE and leave all the settings on default
- Once installed, run Arduino IDE and you should see something similar to below
- If not already installed, head to the Python site and download the latest 3.x version of Python
- Once installed, open up Command Prompt and either navigate to where Python is installed or, if Python is already in your PATH, continue to step 6
- Copy and paste the contents of the rubberduino file into a new file called rubberduino.py and save it
Step 2: Convert your Rubber Ducky script
- Copy and paste your payload into a new text file called payload-before.txt and save it in the same place as your rubberduino.py file
- Back in Command Prompt, run this command
python.exe rubberduino-convert.py payload-before.txt >> payload-after.txt
- Open the payload-after.txt file in your Arduino IDE like so
- Go to Tools -> Board and select Arduino/Genuino Micro
- Insert your Beetle USB
- Go to Sketch -> Verify/Compile and wait until it says Done Compiling
- Go to Sketch -> Port: and select your Beetle USB from the list
- Go to Sketch -> Upload and wait until it says Done Uploading
That’s it! Unplug the USB and close the IDE, and now put the Beetle back into your machine and confirm that your payload executes as expected!