Very simple keylogger, written in Guile Scheme.
This keylogger relies on a shared library written in C; to compile it, use the command
make
With so many event files, how can one possibly know which one corresponds to which? You can find it with this command:
grep -iE -A4 'N: Name=' /proc/bus/input/devices | grep -i -A4 'keyboard' | grep -v "^[PSU]"
The output will be something like
N: Name="AT Translated Set 2 keyboard" H: Handlers=sysrq kbd leds event4
You should look at the field Handlers
. In this case, the keyboard device will be /dev/input/event4
.
With the keyboard device name, run the command
sudo LD_LIBRARY_PATH=./ GUILE_LOAD_PATH=./ guile -e main -s keylogger.scm -i /dev/input/event4 -o keylog.txt
and in the other terminal follow it with:
tail --follow keylog.txt