Skip to content
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
72 lines (49 sloc) 2.03 KB


Keylogger written in Go

Build Status

Status: Done

Record keystrokes in Linux environment. Keylogger listens for input events on selected input device and stores decoded hits in a specified log file. The application requires root permissions.


Screenshot Desktop


  • List available input devices
  • Record keystrokes sent to observed input devices (e.g. keyboards)
  • Collect logged input data in log files


$ go get


$ keylogger 
Usage: keylogger [--version] [--help] <command> [<args>]

Available commands are:
    devices    Lists available input devices
    record     Records any keys pressed on the selected device
    version    Prints the application version


List available input devices:

# keylogger devices
Available event devices:
  event0 (name: "AT Translated Set 2 keyboard", path: /dev/input/event0)
  event1 (name: "Power Button", path: /dev/input/event1)
  event2 (name: "Sleep Button", path: /dev/input/event2)
  event3 (name: "VirtualBox mouse integration", path: /dev/input/event3)
  event4 (name: "ImExPS/2 Generic Explorer Mouse", path: /dev/input/event4)

Start recording input events:

# keylogger record --eventPath=/dev/input/event0 --logPath=/tmp/keylogger.log
Start recording...

See recorded keystrokes in the log file/tmp/keylogger.log:

# cat /tmp/keylogger.log 


Apache License 2.0

A permissive license whose main conditions require preservation of copyright and license notices. Contributors provide an express grant of patent rights. Licensed works, modifications, and larger works may be distributed under different terms and without source code.

You can’t perform that action at this time.