Skip to content

Raspberry Pi and Arduino Pro Micro USB Hardware Keylogger

License

Notifications You must be signed in to change notification settings

TH213/Pi-Keylogger

 
 

Repository files navigation

Pi-Keylogger

Raspberry Pi Zero and Arduino Pro Micro USB Hardware Keylogger. A fork of the project K3yP1.

Disclaimer

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.

Concept

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.

Requirements

Setup Raspberry Pi

  1. 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".
  2. Follow this tutorial(skip step 2 in the tutorial) and ssh into the Raspberry Pi.
  3. 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
  4. Reboot the Raspberry Pi.

The Raspberry Pi is now ready for keylogging.

Setup Arduino Pro micro

  1. Install Arduino IDE and set it up.
  2. Flash the keylogger.ino file with the Arduino IDE to the Arduino Pro Micro.

Setup Keylogger

  1. 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.

40 Pin Raspberry Pi pinout

  1. Connect the Micro USB to USB cable to the Arduino.
  2. Connect the Micro USB to USB Female adapter to the data port of the Raspberry Pi.
  3. Connect the victims keyboard to the Micro USB to USB Female adapter of the Raspberry Pi
  4. Connect the arduino to the victims computer

The assembled keylogger should look as following:

Result

Post-setup

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

About

Raspberry Pi and Arduino Pro Micro USB Hardware Keylogger

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 56.3%
  • Shell 33.9%
  • C++ 9.8%