A keylogger is a type of malicious software that records every keystroke made on a computer's keyboard. It captures user inputs such as passwords, messages, and other sensitive information. While keyloggers can serve legitimate purposes, like monitoring employee activity, they are often misused for malicious intent, such as stealing personal information.
This project, Simple Keylogger in Python, is designed for educational purposes only. It demonstrates how keyloggers function and the mechanisms behind keystroke logging. Understanding these concepts is crucial for cybersecurity awareness and defense strategies.
DO NOT use this keylogger on any real or sensitive data. This code is for educational purposes only and should only be run in a controlled environment, such as a personal computer or a virtual machine, where it cannot cause harm. Misuse of this code could result in data loss or legal consequences.
- Keystroke Logging: Records keystrokes along with timestamps.
- Automatic File Saving: Saves the logged keystrokes to a text file at specified intervals.
- ESC Key Functionality: Stops logging when the ESC key is pressed.
keylogger.py
: The main script that captures and logs keystrokes.
- The script listens for key presses in the background.
- When a key is pressed, it records the keystroke along with a timestamp.
- The captured keystrokes are saved to a text file (
keylogger.txt
) at regular intervals. - The logging process continues until the user presses the ESC key, which stops the listener.
To run this project, you need the following:
- Python 3.x
- pynput library (install via pip):
pip install pynput
- Clone or download the repository.
- Navigate to the project directory.
- Run the keylogger script
python3 keylogger.py
- This will start logging keystrokes until the ESC key is pressed.
This project serves as a learning tool to understand the mechanics of keyloggers. It highlights the importance of cybersecurity practices, such as being aware of software that records user inputs. Always remember to respect privacy and legal boundaries when dealing with such technologies.
Disclaimer: The author is not responsible for any misuse or damage caused by the use of this code. Use at your own risk.
This project is licensed under the MIT License - see the LICENSE file for details.