A C++ implementation of an input logger, accesses the low-level raw data sent by input devices (keyboard and mouse) and records it in a log file.
- Run the following command: ls -l /dev/input/by-{path,id}/
- Locate the event file that controls the event mouse connected with the device
- Change the event file name within the keylogger.cpp, within the main function
- Compile the program using the g++ compiler with the command: g++ -o keylogger keylogger.cpp -lX11
- Make sure to include the -lX11 flag, which links the executible to X11, and thus enables many of the low-level functions used by this program
- Run the executible using the sudo keyword: sudo ./keylogger output.log with output.log being the output log file
- The coordinates displayed by the function correspond to the origin being at the top left corner of the screen
- The absence of sudo in the command would lead to permissions being denied to access the event files within the Linux Event Subsystem
- Access to the output within the log file also requires the sudo keyword