Raspberry Pi Zero and Arduino Pro Micro USB Hardware Keylogger. A fork of the project K3yP1.
This project is a proof of concept and is not meant to be used maliciously. I do not take any responsibility for any damage this project can cause.
The device sits as a MITM between a USB keyboard and the victim computer. The Keyboard is plugged into the Raspberry Pi which logs each character. The Raspberry Pi then passes the character over to the Arduino Pro Micro, using Serial communication, which emulates the keystroke and passes it on to the victims computer.
- 5v Arduino Pro Micro
- Raspberry Pi with a header
- Female to Female Jumper Cables
- Micro USB to USB Female adapter
- Micro USB to USB adapter
- Micro SD card
- Flash Raspberry Pi OS to a micro SD card. Follow this tutorial to flash the Raspberry Pi OS and enable SSH and Wifi. I recommend installing Raspberry Pi OS Lite as it is smaller and runs faster. To install it using the official Raspberry Pi Imager, go to "CHOOSE OS", then "Raspberry Pi OS (other)" and select "Raspberry Pi OS Lite".
- Follow this tutorial(skip step 2 in the tutorial) and ssh into the Raspberry Pi.
- Install the necessary dependencies and configure the Raspberry Pi by executing this command:
sudo wget -O - https://raw.githubusercontent.com/apacelus/Pi-keylogger/master/install.sh | sudo bash
- Reboot the Raspberry Pi.
The Raspberry Pi is now ready for keylogging.
- Install Arduino IDE and set it up.
- Flash the keylogger.ino file with the Arduino IDE to the Arduino Pro Micro.
- Connect the Raspberry Pi to the Arduino according to the table below.
Pi Pro Micro Colour
---------------------------------
5v RAW Red
GPIO14/TXD RX Yellow
GPIO15/RXD TX Black
GND GND Green
The pinout of the Arduino is printed on the board itself, whilst the pinout of the Raspberry Pi can be seen bellow.
- Connect the Micro USB to USB cable to the Arduino.
- Connect the Micro USB to USB Female adapter to the data port of the Raspberry Pi.
- Connect the victims keyboard to the Micro USB to USB Female adapter of the Raspberry Pi
- Connect the arduino to the victims computer
The assembled keylogger should look as following:
When connecting to the Raspberry Pi after setting up the device or recovering it after logging keystrokes it will automatically run the keylogger script. To end the script and view the log files, press ctrl+e