Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Making it more stealthy (recognized as keyboard & mouse only)
List of content:
-Pros and cons
-Step by step guide
-Reverting it to original state
- PC won't know that it's an Arduino
- PC won't recognize it as multiple devices
- Possibly lower set up time after first plug-in on the new machine (need a proof though, didn't test it enough)
- Gets reliability comparable with the original HAK5 rubber ducky
I used USBDeview program to see how it's recognized by PC
- Board can't be programmed through USB anymore (can be programmed through USB if it gets reverted with the same equipment that was used to make it stealthy)
- Possibly board could be bricked but idk... It's just my assumption (correct wiring and firm connection are important)
- Requires additional parts, time and effort to be done
- It is necessary to modify core Arduino files (However in this guide there's a cool, convienient way of choosing the core-files based on the board choice without the need to manually edit+revert core files every time)
- I did not test this method with Arduino IDE versions other than 1.8.5
- Re-installation of Arduino IDE will erase any settings created using this tutorial, which means that it would be necessary to go through the tutorial again
- Inability to read debug information through Serial Monitor anymore
- Arduino UNO (or clone, I used Sintron UNO) + standard USB cable for it
- 6 Clips/hooks like these (to grab the pins without soldering)
- 6 Male to male jumper wires
From my observations when you plug supremeDuck or any other Arduino based BadUSB (e.g. Malduino) into PC it gets recognized by it as:
- Human Interface Device
- Arduino Leonardo x 2
The point of this guide is to make it recognized as Human Interface Device only. Arduino UNO will be used as ISP (In-system programmer). It will be flashed with the code found in standard examples of Arduino IDE, then connected to the Arduino-Pro-Micro/supremeDuck/Malduino/Atmega32U4/etc and used to flash the code without bootloader and without CDC (Communication Device Class) interface being initialized.
Additional aim of this guide is to make it easy to repeat/revert this process in further attempts without the need to copy/modify/backup/revert any files (unless Arduino IDE is reinstalled). To achieve that there will be:
- copy of arduino core folder "arduino_hid_only" which will be assigned to the newly created board's setting
- additional board setting added to board.txt file called "Arduino Leonardo (HID only)"
- additional programmer setting added in programmers.txt file (+ name of the current "Arduino as ISP" modified to display its purpose)
Step by step guide
- Make copy of arduino folder located at: Arduino/hardware/arduino/avr/cores
- Rename the copy to arduino_hid_only.
- Open the newly renamed folder and open USBCore.cpp file.
- Comment out the lines marked on the 2 images below.
Save the file.
Open board.txt file located at Arduino-installation-folder/hardware/arduino/avr
I used Notepad++ for editing which shows index of each line so desired text is easier to find. You could make a backup of the file in case if something goes wrong.
- Copy the following text:
leonardo_stealthy.name=Arduino Leonardo (HID only)
- Locate the text selected on the image below.
- Paste the previously copied text under it so it looks like:
Save the file.
After re-launching Arduino IDE you should see the following options available:
Don't just close 1 of the opened Arduino sketches, make sure that all sketches are closed and then run Arduino again to see the change.
**WARNING: ** don't upload the code through USB with "Arduino Leonardo (HID only)" board setting. Always use "Sketch -> Upload Using Programmer" option.
- Open programmers.txt file located in the same folder.
- Copy the following text.
arduinoasisp.name=Arduino as ISP (Upload using programmer)
arduinoasisp_boot.name=Arduino as ISP (Burn bootloader)
- Locate the selected text on the image below.
- Replace the located text with the previously copied one, so it should looks like this:
- After re-launching Arduino IDE you should see the following options available:
- Prepare the programmer
- Connect Arduino Uno to PC (it will become the programmer)
- Open arduino IDE -> File -> Examples -> ArduinoISP -> ArduinoISP
- Tools -> Board -> Arduino/Genuino Uno
- Tools -> Port -> Com X (Arduino Uno)
- Upload the sketch
- Disconnect the Arduino Uno from PC
- Connect the target board (e.g. supremeDuck) to the newly created programmer (Arduino UNO) using the wiring below.
Use 3.3V pin if your board is running on 3.3V (e.g. Pro Micro 8Mhz or Malduino Elite). More detailed wiring info and alternative picture: https://schou.dk/linux/arduino/isp/
I used tape to keep the connectors in the same arrangement for future uploads.
- Connect Arduino Uno to PC and choose the options shown below.
- Make sure that the wiring is correct and click Sketch->Upload Using Programmer.
If there is a problem with uploading process and there is no firm connection between 2 boards (e.g. using of tied cables instead of clips or solder) then most likely it's a connection problem.
- After uploading process is completed all the leds should be emmiting steady light.
Disconnect Arduino Uno, disconnect clips from the supremeDuck.
At this point it the process should be completed and it should be recognized as HID only.
If for some reason it does not work you could try the reverting steps below.
Reverting to original state
Make sure that the Arduino Uno is flashed with the ArduinoISP code and connected appropriately to the target device (Arduino Pro Micro, supremeDuck etc.)
Pick the options shown on the image below and press "Burn bootloader".
- After the process is completed the device should be able to be programmed by USB like it was before.