Prepare your Rubber Ducky
1 Download Duck Encoder
Open Terminal on your machine and make sure Java is installed by running sudo apt-get install default-jre. Download the Duck Encode by running the command wget https://github. com/ hak5darren/ USB-Rubber-Ducky/ blob/ master/duckencoder.jar.
Next, insert the Duck microSD card into the reader, then plug the reader into a vacant USB port. Check the exact name of your card in your /media folder, for example / media/nate/A87B-A154/. Then reopen Terminal and run nano helloworld.txt to create a text file.
2 Prepare your payload
Paste the following: REM MY FIRST SCRIPT DELAY 5000 CTRL ESC DELAY 5000 STRING notepad.exe ENTER DELAY 5000 STRING YOU’VE BEEN QUACKED!! ENTER Press Ctrl+X, Ctrl+ Y, then Return to save the payload and exit.
3 Execute the payload
Next, run java -jar duckencode.jar -i helloworld.txt -o <sd location>/inject.bin, replacing <sd location> with the relevant location on your system. Use your File Manager to eject the microSD card safely or run eject <device>.
Now remove the card from the USB reader and insert it gently into the USB Rubber Ducky. Find a Windows machine you can legally access and insert the device at any time when the user is logged in. This script has deliberately been slowed to show the workings of the Rubber Ducky.