Design a Keylogger in Python
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 than not it is used for malicious intents like stealing passwords.
This article illustrates designing a keylogger for windows and Linux.
Keylogger for Windows
Download some python libraries
Following is the code to create a keylogger in python
Save the file in C:\ as Keylogger.py and run the python 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 write.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.
Please Login to comment...