Rubber Ducky

I decided to try out the USB Rubber Ducky http://usbrubberducky.com/ from www.hak5.org.  The downside to the Rubber Ducky is that it does not come with very good documentation for those that want to set it up on the Windows side.  I had a difficult time with the creating the sample tutorial Hello Word duck script, but after an hour or so was able to work through it.  Here is how to setup the Duck from a Windows machine.

  1. Make for sure you have the latest version of Java installed on your computer, and that the Java directory is in your PATH Environment Variable.
  2. Download the DuckEncoder (duckencode.jar) from https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Downloads.  The Duck Encoder was at version 1.2 at the time of this post.  I would recommend creating a directory to hold the Duck Encoder file and the scripts you are going to create.
  3. Remove the MicroSD card from the Duck.  This can be difficult as the MicroSD is very snug, but it will come out.   I actually had to use needle nose pliers to get mine out.
  4. Insert the MicroSD card into the included adapter and plug into a USB slot on your Windows machine.  Your MicroSD card will be assigned a drive letter.
  5. (Optional) Browse to the drive letter and rename the file inject.bin to something like injectOriginal.bin.  I did this to preserve the original inject.bin file on the Duck.
  6. Open Notepad and key in your Duck script.  I used the Hello World script from https://github.com/hak5darren/USB-Rubber-Ducky/wiki/My-first-payload.  Note that if you copy and paste this script into notepad, you will need to remove the blank space at the beginning of each line, otherwise you will get an error.
  7. Save your file (i.e. helloWorld.txt), preferably into the folder with the duckencode.jar file.
  8. Open a command prompt and change to the directory with your script and duckencode.jar files.
  9. At the command prompt, key the following:  java -jar duckencode -i helloWorld.txt -o f:\inject.bin  ##(Note that your drive letter may be different)
  10. Safely remove the USB adapter from your system and insert the MicroSD card back into the Duck.
  11. Insert the duck into a USB port and your script should run.

Some sample payloads are available at https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Payloads .