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.
- 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.
- 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.
- 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.
- 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.
- (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.
- 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.
- Save your file (i.e. helloWorld.txt), preferably into the folder with the duckencode.jar file.
- Open a command prompt and change to the directory with your script and duckencode.jar files.
- 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)
- Safely remove the USB adapter from your system and insert the MicroSD card back into the Duck.
- 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 .