This project simulates a cross-platform keylogger built for educational purposes as a final year cybersecurity project. It demonstrates how keylogging mechanisms work, how they can be monitored, and how one can defend against such tools. It includes a Python-based keylogger and a Flask-based web dashboard to visualize the captured keystrokes.
⚠️ DISCLAIMER: This tool is for educational and ethical use only. Unauthorized use of any keylogging software may violate laws and privacy regulations (e.g., GDPR). Use responsibly and only in controlled lab environments with explicit permission.
keylogger-simulator/
│
├── key-logger.py # Keylogger script that logs keystrokes to keylog.txt
├── app.py # Flask app to serve the dashboard and display logs
├── setup_keylogger.bat # Optional: Windows setup script for auto-start
│
├── templates/ # HTML templates for Flask
│ ├── dashboard.html # Dashboard UI showing keylog content
│ └── disclaimer.html # GDPR and ethical use disclaimer
│
└── static/ # Static assets like CSS, JS, images
└── style.css # Custom styles for the dashboard
- ✅ Keylogging functionality across Windows, macOS, and Linux
- ✅ Periodic flush of captured keystrokes to a text file
- ✅ Web-based dashboard to visualize logs live
- ✅ Disclaimer page for ethical and legal notice
- ✅ Auto-start setup for Windows login (via batch + registry)
- ✅ Logs endpoint for backend log access (JSON)
git clone https://github.com/Tengen-12/key-logger.git
cd key-loggerpip install flask pynputpython key-logger.pyThis starts the keylogger and logs keys to keylog.txt.
python app.pyAccess it in your browser:
http://127.0.0.1:5000/
Only for lab/demo use. Requires Admin Rights.
Run the following batch file to:
- Build a keylogger
.exe - Move it to AppData
- Set it to run at every user login via registry
setup-keylogger.batIt creates a registry entry under:
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
- The dashboard contains a disclaimer.html section explaining the ethical boundaries.
- This project is fully compliant with educational research scenarios.
- No sensitive data should be collected or misused.
- Built to demonstrate detection and defense, not exploitation.
- ✅ Works on Windows, macOS, and Linux
- Tested on:
- Windows 10/11
- Ubuntu 22.04
- macOS Ventura
Example of live keystroke monitoring via Flask web dashboard.
- Low-level input capturing via
pynput - Python file handling and flush strategies
- Flask routes and frontend-backend integration
- Ethical coding practices (GDPR, disclaimers)
- Registry autostart setup and EXE bundling
This keylogger simulator is still a work in progress. While it performs core functions like keylogging and log visualization, enhancements and bug fixes are ongoing.
If you encounter any issues, have suggestions, or would like to contribute to improvements:
📧 Contact Me:
[email protected]
https://github.com/Tengen-12
Aditya Barokar
Cybersecurity Analyst
This project is licensed under the MIT License.

