|
NCP115AMX330TCGonsemi
|
x 1 | |
|
STM32F042G6U6STM
|
x 1 | |
|
1541201NC3060Wurth Electronics
|
x 4 | |
|
CL05A475KP5NRNC |
x 1 | |
|
RC0402FR-0710KLYaego
|
x 1 | |
|
CL05A105KO5NNNC |
x 2 |
![]() |
KiCad 8.0KiCad
|
|
![]() |
STM32CubeIDESTMicroelectronics
|
|
![]() |
STM32CubeProgrammerSTMicroelectronics
|
Hidden HID: an invisible USB Rubber Ducky
Hidden HID is a tiny 8x12x0.4mm thick PCB that can be concealed entirely inside a USB A port. Once inside, is almost entirely undetectable to the untrained eye. All components in the circuit are placed on the bottom layer, directly under the USB contacts on the top layer.
Hidden HID is able to present itself to the computer as a HID device, such as a keyboard, allowing it to inject arbitrary keystrokes, including potentially malicious code. I have included a basic hello world example in my github repo, but at the end of the day its up to you how you program it ;-)
Being only 0.4mm thick, the PCB needs to be held up inside the port somehow, to maintain good connection with the USB contacts and to stop it falling out of the port. I solve this using four phototransistors of about 1.8mm height as spacer elements, two on each side, giving the device a total thickness of about 2.2mm. The phototransistors also have a function within the circuit, making it possible to enable and disable the device remotely after insertion, using an external IR transmitter (not provided - I used a 3W transmitter with 940nm wavelength and had a maximum range of about 0.5-1m).
The circuit itself is very simple, consisting of a USB-enabled STM32 microcontroller, an LDO to step down the 5V USB supply, and two of the phototransistors wired in parallel connected to the ADC input of the STM32. The STM32 is programmed using the integrated USB bootloader. To program, simply solder a small piece of magnet wire or similar between the middle test pad (BOOT0) and the test pad on the right (3V3). Insert the PCB into your USB port and use the STMCubeProgrammer to download your hex file. To run the application, remove the wire between BOOT0 and 3V3 and instead connect BOOT0 and GND (the test pad on the left).
Once inserted, the PCB can be removed using any small plastic tool, for example some thin plastic tweezers. Just stick this inside the port and wiggle it around behind the phototranistors - it should pop right out. It is very important to use plastic instead of metal to avoid short-circuiting the PCB or causing mechanical damage to the USB port. Obviously use at your own risk - if you are afraid to damage your computer, you can always use a USB hub to test it or wait until the computer has shut down before removing it.
It is possible that a 0.6mm thick PCB may be more suitable (total thickness 2.4mm, closer to USB port internal height of 2.5mm) but I have not tested this as I was worried a tighter fit might make removal from the port more challenging.
Important note for assembly: the 1541201NC3060 phototransistors are a reverse mount type, meaning they are supposed to be soldered upside down, with the lens poking through a hole in the board. In fact, every availeble IR phototransistor I could find with the required height seems to be a reverse mount type. In order to mount them normally, as we need to do for this design, they must be hand-soldered. PCBWay were able to do this for me after informing me of the unusual intended assembly.

Hidden HID: an invisible USB Rubber Ducky
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(3)
-
Engineer Jan 25,2025
-
Rain Haase Jan 21,2025
-
Engineer Jan 21,2025
- 2 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10

-
10design
-
10usability
-
10creativity
-
10content

-
10design
-
10usability
-
10creativity
-
10content
More by Engineer
-
Instrumentation Input, high impedance with 16 bit 1MSPS ADC for SPI
47 0 0 -
RGB LED Matrix input module for the Framework Laptop 16
241 0 2 -
-
📦 StackBox: Modular MDF Storage Solution 📦
98 0 2 -
-
-