Keystroke logging, is the process of recording (logging) the keys pressed on a keyboard (usually when the user is unaware). It is also known as keylogging or keyboard capturing.
These programs are used for troubleshooting technical problems with computers and business networks. It can also be used to monitor network usages but more often then not it is used for malicious intents like stealing passowrds.
This article illustrates designing keylogger for windows and linux.
Keylogger for Windows
Following is the code to create keylogger in python
Save the file in C:\ as Keylogger.py and run thepython file
The keylogger will be started in the background and save all the data on the log file “c:\output.txt”.
Keylogger in Linux
pyxhook requires python-xlib. Install it if you don’t have it already.
sudo apt-get install python-xlib
Download pyxhook library
The keylogger will be started in the background and save all the data on the file.log file “/home/akash/Desktop”.
This article is contributed by Akash Sharan. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.