This is a basic keylogger built with Python. Keyloggers are programs designed to capture keyboard input. While they can be useful for personal productivity tracking or testing keyboard input in applications, they are often used for unethical purposes. This project is intended strictly for educational and ethical research purposes.
This keylogger records every keystroke and logs them into a file named keylogger.txt
. Additionally, the contents of this file (i.e., the captured keystrokes) are sent to a predefined email address using Python's built-in smtplib
.
β οΈ Disclaimer: Unauthorized use of keyloggers is illegal and unethical. Only run this code on machines you own or have explicit permission to test on.
- Logs all keyboard input into
keylogger.txt
- Sends the captured keystrokes to a specified email address
- Exits cleanly when the
Esc
key is pressed - Easily extendable to send logs at regular intervals (not implemented in this version)
-
Make sure you have Python installed.
-
Install the required Python module:
pip install pynput
-
Run the keylogger:
python keylogger.py
π Press
Esc
to stop the keylogger.
pynput
β For listening to keyboard eventssmtplib
andssl
β For sending emails (comes pre-installed with Python)
- The script is not compiled into an executable, so it needs to be explicitly run using the Python interpreter.
- You may configure the email and interval logic to extend the functionality, such as sending periodic reports.
This tool is intended to learn how keystroke capturing works, understand the risks, and promote awareness around digital security. Use responsibly.