Arduino UNO as HID Keyboard + payloads

USB keystroke injection tools like HAK5’s Rubber Ducky or Maltronics MalDuino have interested me for a long time now, but the exchange rate makes them prohibitively expensive (or rather out of my price range!) not to mention international shipping cost.

Maltronics did a video on how he made the MalDuinos at the time by hand, and I did some research and found he also did a great video creating a similar thing yourself with using an arduino that has native HID support, and using an sdcard reader.

I only have a few UNO & MEGA, so started researching if it was even possible to turn an Arduino UNO into a USB Keystroke Injection tool. Turns out you can!
I even added buttons for different payloads (3), plus 3 led indicators. The LED’s really with helped debugging timings in keyboard mode, and also helped visualize the sequences in usb mode.

The Finished Project

The UNO really isn’t the fastest kid on the block, and injection is spotty if timings aren’t correct. I tested it on 3 different windows 10 machines, and learned timings matter! It’s all about the speed of the PC, and timings of the UNO. I mucked around back and forth in keyboard/USB mode for 8 hours or so getting a simple payload working correctly, on all 3 PC’s. The original HID-keyboard.h with the mappings were broken in places and I ended up fixing those, as it wouldn’t print a comma (or a few other characters too).
Then it was all about creating the keyboard injections and timings for each step, while finding the most optimal way to achieve results and not bugout. by bugout I mean timings are off and suddenly all sorts of things are opening and typing onto etc that was totally unintended and frustrating!

It’s slow! and comical, but very satisfying.

Payload 1 in action. (open notepad and type then end & open url)
Payload 2 in action (Download and change wallpaper)

A fun project, that certainly kept me busy for a few days, and I learned a lot about keystroke injection and a lot more appreciation for programming in C on a micro controller level. I’m working to make a complete walk through with code.
I just wanted to get this up as it’s really been about 3 full days of fun and I’m finally happy with the end result.

Version 3? – proper HID support & sdcard reader. —-> next…. ?