A lightweight Python-based keylogger that captures and records keyboard inputs. This project demonstrates how to use Python's pynput library to monitor keyboard events and log them into a text file.
- Keystroke Logging: Captures and logs all keystrokes, including alphanumeric and special keys.
- Special Key Support: Handles and logs keys like
Space,Enter, andBackspacein a readable format. - File-Based Logging: Saves all logged keystrokes into a text file (
keylog.txt) for analysis. - Simple and Lightweight: Minimal dependencies and straightforward to use.
- Clone the Repository:
git clone https://github.com/<your-username>/python-keylogger.git cd python-keylogger
βοΈ How It Works The script listens for all keyboard events using the pynput library. Each keystroke is logged and written to a file named keylog.txt. Special keys (e.g., Enter, Space, Backspace) are logged with descriptive names to maintain readability. π Usage Examples Educational: Learn how to implement keylogging and understand event-listening in Python. System Monitoring: Monitor keyboard activity for personal systems (with explicit consent). π Legal Disclaimer This project is intended for educational purposes only. Unauthorized use of keylogging tools is illegal and unethical. Ensure you have explicit consent before using this software on any system. Misuse of this project may result in severe legal consequences. Use responsibly.
π€ Contributions Contributions are welcome! If you'd like to improve or extend the functionality:
Fork the repository. Create a new branch. Submit a pull request with your changes.
README.md markdown Copy Edit
A lightweight Python-based keylogger that captures and records keyboard inputs. This project demonstrates how to use Python's pynput library to monitor keyboard events and log them into a text file.
- Keystroke Logging: Captures and logs all keystrokes, including alphanumeric and special keys.
- Special Key Support: Handles and logs keys like
Space,Enter, andBackspacein a readable format. - File-Based Logging: Saves all logged keystrokes into a text file (
keylog.txt) for analysis. - Simple and Lightweight: Minimal dependencies and straightforward to use.
- Clone the Repository:
git clone https://github.com/<your-username>/python-keylogger.git cd python-keylogger
Install Dependencies: Ensure Python 3 is installed. Install the required library:
bash Copy Edit pip install pynput Run the Keylogger: Execute the script:
bash Copy Edit python keylogger.py βοΈ How It Works The script listens for all keyboard events using the pynput library. Each keystroke is logged and written to a file named keylog.txt. Special keys (e.g., Enter, Space, Backspace) are logged with descriptive names to maintain readability. π Usage Examples Educational: Learn how to implement keylogging and understand event-listening in Python. System Monitoring: Monitor keyboard activity for personal systems (with explicit consent). π Legal Disclaimer This project is intended for educational purposes only. Unauthorized use of keylogging tools is illegal and unethical. Ensure you have explicit consent before using this software on any system. Misuse of this project may result in severe legal consequences. Use responsibly.
π€ Contributions Contributions are welcome! If you'd like to improve or extend the functionality:
Fork the repository. Create a new branch. Submit a pull request with your changes. π License This project is licensed under the MIT License. See the LICENSE file for details.
π Acknowledgments Special thanks to the creators of the pynput library for making keyboard event monitoring in Python simple and efficient.