{"id":42293386,"url":"https://github.com/ashinno/keylogger","last_synced_at":"2026-01-27T09:53:07.079Z","repository":{"id":269683292,"uuid":"908138933","full_name":"ashinno/keylogger","owner":"ashinno","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-15T11:02:11.000Z","size":11905,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-16T04:06:40.855Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashinno.png","metadata":{"files":{"readme":"Readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-25T08:38:24.000Z","updated_at":"2025-10-15T11:02:15.000Z","dependencies_parsed_at":"2024-12-25T10:21:38.168Z","dependency_job_id":"1abb2d5a-da6b-46b7-bb03-ac282caf78d0","html_url":"https://github.com/ashinno/keylogger","commit_stats":null,"previous_names":["ashinno/keylogger"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ashinno/keylogger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashinno%2Fkeylogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashinno%2Fkeylogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashinno%2Fkeylogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashinno%2Fkeylogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashinno","download_url":"https://codeload.github.com/ashinno/keylogger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashinno%2Fkeylogger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28811483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-27T09:53:06.571Z","updated_at":"2026-01-27T09:53:07.073Z","avatar_url":"https://github.com/ashinno.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Enhanced Keylogger Project\n\nA comprehensive, modular keylogger application with advanced security, privacy, and monitoring features.\n\n## Table of Contents\n1. Project Overview\n2. Technical Specifications\n3. Installation Guide\n4. Usage Instructions\n5. Feature Documentation\n6. Contribution Guidelines\n7. Troubleshooting\n8. License Information\n\n## 1. Project Overview\nPurpose: The Enhanced Keylogger helps you monitor and analyze keyboard, mouse, clipboard, window focus, screenshots, USB events, and performance data on authorized systems, with strong security and privacy controls. It is designed for legitimate use cases such as usability testing, parental control, endpoint monitoring within your organization, and academic/security research where you have explicit permission.\n\nObjectives:\n- Provide comprehensive, configurable input and activity monitoring\n- Preserve privacy via sanitization, hashing, and application exclusions\n- Ensure security with encryption and access control\n- Offer a web interface and tools for real-time monitoring and post-hoc analysis\n- Maintain reliable performance with buffering, rotation, and resource tracking\n\nTarget audience and use cases:\n- Security analysts and researchers evaluating user behavior or system usage patterns\n- IT administrators monitoring corporate endpoints with consent and policy\n- Parents or guardians monitoring family devices with consent\n- QA/usability teams capturing interaction data during tests\n\n## 2. Technical Specifications\nSystem architecture and components:\n- Core services orchestrate configuration, encryption, logging, and the main keylogger runtime.\n- Listeners capture inputs/events: keyboard, mouse, and clipboard under listeners/.\n- Utilities monitor environment: window focus/usage, screenshots, USB device changes, and performance under utils/.\n- Web interface built with Flask for dashboard, logs, configuration, export, and performance views under web/ with templates/ and static/ assets.\n- Parsers provide log parsing and export for analysis under parsers/.\n\nKey modules and responsibilities (non-exhaustive):\n- core.config_manager: load, validate, and provide configuration values\n- core.encryption_manager: manage encryption keys and AES-256-GCM operations\n- core.logging_manager: buffered, encrypted log writing with rotation\n- core.keylogger: orchestrates listeners, lifecycle, and exports\n- listeners.keyboard_listener: keystroke capture, sensitive data filtering, shortcut detection\n- listeners.mouse_listener: click, movement, scroll tracking\n- listeners.clipboard_listener: clipboard polling with size and privacy limits\n- utils.window_monitor: active window tracking and usage timing (Windows-focused)\n- utils.screenshot_monitor: periodic screenshots with blur/redaction and compression\n- utils.usb_monitor: USB connect/disconnect detection and device details\n- utils.performance_monitor: CPU/memory/disk/network plus keylogger metrics\n- web.app: Flask routes for login, dashboard, logs, config, export, performance\n- parsers.log_parser: parsing, statistics, and export to text/CSV/JSON\n\nDependencies and requirements:\n- Python 3.8+ with pip\n- See “Requirements” for the full dependency list and versions\n- Windows-specific functionality (active window and some USB details) requires pywin32\n\nTechnical constraints and considerations:\n- Platform differences: active window and some USB metadata collection are Windows-oriented; on other OSes, these features may be reduced or disabled\n- Permissions: some environments require elevated privileges to capture inputs or access system APIs\n- Privacy and compliance: configure exclusions, sanitization, and encryption according to your policies and local laws\n- Performance: screenshots and high-frequency polling can be resource intensive; adjust intervals and buffer sizes via config.json\n\n## 🚀 Features\n\n### Core Functionality\n- **Keyboard Monitoring**: Advanced keystroke capture with modifier key support\n- **Mouse Tracking**: Comprehensive mouse event logging (clicks, movements, scrolls)\n- **Clipboard Monitoring**: Real-time clipboard content tracking\n- **Window Tracking**: Active window and application usage monitoring\n- **Screenshot Capture**: Automated screenshot taking with privacy controls\n- **USB Device Monitoring**: Track USB device connections/disconnections\n- **Performance Monitoring**: System resource usage tracking\n\n### Security \u0026 Privacy\n- **Data Encryption**: AES-256-GCM encryption for all logged data\n- **Privacy Filters**: Automatic detection and sanitization of sensitive data\n- **Stealth Mode**: Hidden operation with configurable visibility\n- **Access Control**: Password protection and user authentication\n- **Secure Key Management**: Encrypted key storage with rotation support\n\n### Performance \u0026 Reliability\n- **Buffered Logging**: Efficient event buffering with automatic flushing\n- **Resource Optimization**: Memory and CPU usage monitoring\n- **Error Handling**: Comprehensive error recovery and logging\n- **Modular Architecture**: Clean separation of concerns\n- **Cross-Platform Support**: Windows, macOS, and Linux compatibility\n\n### Advanced Features\n- **Web Interface**: Real-time monitoring dashboard\n- **Remote Logging**: Send logs to remote servers\n- **Email Alerts**: Automated notifications for important events\n- **Log Analysis**: Advanced parsing and reporting tools\n- **Configuration Management**: Dynamic configuration updates\n- **Export Capabilities**: Multiple output formats (JSON, CSV, TXT)\n\n## 📋 Requirements\n\n### System Requirements\n- Python 3.8 or higher\n- Windows 10/11, macOS 10.14+, or Linux (Ubuntu 18.04+)\n- Minimum 4GB RAM\n- 1GB free disk space\n\n### Python Dependencies\n```\npsutil\u003e=5.9.0\ncryptography\u003e=3.4.8\npynput\u003e=1.7.6\nPillow\u003e=9.0.0\nrequests\u003e=2.28.0\npyperclip\u003e=1.8.2\npywin32\u003e=304 (Windows only)\nflask\u003e=2.2.0\nwatchdog\u003e=2.1.9\nclick\u003e=8.1.0\npytest\u003e=7.0.0\npytest-cov\u003e=4.0.0\nblack\u003e=22.0.0\nflake8\u003e=5.0.0\nmypy\u003e=0.991\n```\n\n## 🛠️ Installation\n\n### Quick Setup (recommended)\n```bash\npython setup.py\n```\nThis will:\n- Check Python version\n- Create required directories (keys, logs, screenshots, core, listeners, utils, parsers, web, tests)\n- Install dependencies from requirements.txt\n- Generate a default config.json\n- Generate an encryption key at keys/encryption.key\n- Run basic tests and optionally configure autostart\n\nIf you prefer manual setup, follow the steps below.\n\n### 1. Clone the Repository\n```bash\ngit clone \u003crepository-url\u003e\ncd keylogger\n```\n\n### 2. Install Dependencies\n```bash\npip install -r requirements.txt\n```\n\n### 3. Initial Configuration\n- If config.json does not exist, run the setup script above (python setup.py) to create one with sensible defaults.\n- Update credentials and secrets:\n  - web.admin_username and web.admin_password for the web interface login\n  - web.secret_key to a strong random value\n- Review privacy, performance, and feature toggles according to your needs.\n\n### 4. Generate Encryption Key\n```bash\npython -c \"from core.encryption_manager import EncryptionManager; EncryptionManager('keys/encryption.key')\"\n```\nThis will initialize and persist a secure key at keys/encryption.key if it does not already exist.\n\n## 🚀 Usage\n\n### Basic Usage\n```bash\n# Start keylogger in interactive mode\npython main.py\n\n# Start with web interface\npython main.py --web-only\n\n# Run as daemon (background)\npython main.py --daemon\n\n# Parse existing log files\npython main.py --parse path/to/logfile.txt\n```\n\n### CLI Reference\n- -c, --config PATH: Configuration file path (default: config.json)\n- -w, --web-only: Run web interface only\n- -d, --daemon: Run as daemon (background)\n- --parse FILE: Parse an existing log file instead of running the keylogger\n- -o, --output FILE: Output file when parsing (default varies by format)\n- -f, --format {text,csv,json}: Output format when parsing (default: text)\n- --version: Show version and exit\n\n### Web Interface\n1. Start with web interface: `python main.py --web-only`\n2. Open browser to `http://localhost:5000`\n3. Login with configured credentials\n4. Monitor real-time activity and manage settings\n\nNote: The web interface credentials are read from config.json at web.admin_username and web.admin_password. Older configs using web.username and web.password are automatically migrated to the new keys on the next run; you can also rename them manually if desired.\n\n### Interactive Commands\nWhen running in interactive mode, use these commands:\n- `status` - Show current keylogger status\n- `stats` - Display statistics\n- `export \u003cformat\u003e \u003cfile\u003e` - Export logs (json/csv/txt)\n- `config` - Reload configuration\n- `stop` - Stop keylogger\n- `quit` - Quit application\n- `help` - Show available commands\n\n## 5. Feature Documentation\n\n### Keyboard Listener (listeners/keyboard_listener.py)\n- Functionality: Captures key presses/releases, detects shortcuts, buffers text with flush behavior, and filters sensitive input.\n- Privacy/Security: Sensitive data detection and sanitization; configurable keywords via privacy.sensitive_keywords and toggles via privacy.sanitize_passwords and privacy.hash_sensitive_data.\n- Performance: Adjustable flush thresholds and typing timeouts to minimize overhead.\n- Enable/Disable: features.keyboard (true/false).\n- Known limitations: OS-level permissions may restrict capture in elevated or protected apps.\n\n### Window Monitor (utils/window_monitor.py)\n- Functionality: Tracks active window changes and time spent per application; sanitizes window titles for privacy.\n- Config: features.window_tracking, performance.window_check_interval.\n- Platform: Primarily Windows-focused; functionality may be reduced on macOS/Linux.\n- Known limitations: Some system or UWP apps may not expose details; permissions can limit access.\n\n### Screenshot Monitor (utils/screenshot_monitor.py)\n- Functionality: Periodic screenshots with optional blur/redaction, compression, resolution limits; can hash/encrypt outputs.\n- Config: features.screenshots (enable/disable), performance.screenshot_interval, privacy exclusions/filters.\n- Security: Supports encryption and hashing for tamper detection and confidentiality.\n- Performance considerations: Screenshots can be resource-intensive; tune interval and compression.\n- Known limitations: Some environments block screenshot capture; redaction rules depend on configuration.\n\n### USB Monitor (utils/usb_monitor.py)\n- Functionality: Detects USB device connect/disconnect events and logs details; uses psutil cross-platform and win32 APIs on Windows for richer metadata.\n- Config: features.usb_monitoring; polling/check intervals.\n- Platform: Works cross-platform with reduced metadata outside Windows.\n- Known limitations: Vendor/product details may be unavailable on certain OSes; timing granularity limited by polling interval.\n\n### Performance Monitor (utils/performance_monitor.py)\n- Functionality: Tracks CPU, memory, disk, network, and keylogger-specific metrics (process memory/CPU, threads, events logged).\n- Config: performance thresholds (e.g., max_memory_usage_mb), history size, and sampling intervals.\n- Use cases: Alerting on resource spikes, tuning intervals and buffer sizes based on observed load.\n\n### Web Interface (web/app.py)\n- Routes: /login, / (dashboard), /logs (+ /api/logs), /config (+ /api/config), /export (+ /api/export), /performance (+ /api/performance), /test.\n- Auth: Basic session auth using credentials from web.admin_username and web.admin_password; secret set via web.secret_key; web.debug controls debug mode.\n- Notes: Protect access, change defaults, and bind host/port via web.host and web.port.\n\n### Log Parser (parsers/log_parser.py)\n- Functionality: Parses keylogger output for reporting and export to text/CSV/JSON.\n- CLI: See Usage \u003e CLI Reference and Log Analysis section for examples.\n\n## 🐛 Troubleshooting\n\n### Common Issues\n\n#### Permission Errors\n```bash\n# Run with administrator privileges (Windows)\nrunas /user:Administrator python main.py\n\n# Use sudo on Linux/macOS\nsudo python main.py\n```\n\n#### Missing Dependencies\n```bash\n# Reinstall all dependencies\npip install -r requirements.txt --force-reinstall\n```\n\n#### Configuration Errors\n```bash\n# Validate configuration (example check)\npython -c \"from core.config_manager import ConfigManager; cm = ConfigManager('config.json'); errs = cm.validate_config(); print('Valid' if not errs else f'Invalid: {errs}')\"\n```\n\n#### Performance Issues\n- Reduce buffer sizes in configuration\n- Disable unnecessary features\n- Increase flush intervals\n- Monitor system resources\n\n### Debug Mode\n- Set logging.level to \"DEBUG\" in config.json and restart the application.\n- Optionally set web.debug to true for verbose Flask output.\n- View runtime logs:\n  - Windows (PowerShell): `Get-Content .\\keylogger_main.log -Wait`\n  - Linux/macOS: `tail -f keylogger_main.log`\n\n## 📝 Changelog\n\n### Version 2.0.0 (Current)\n- Complete architectural refactor\n- Enhanced security and encryption\n- Web interface implementation\n- Advanced privacy controls\n- Performance optimizations\n- Comprehensive testing suite\n\n### Version 1.0.0 (Legacy)\n- Basic keystroke logging\n- Simple file output\n- Minimal configuration\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit changes (`git commit -m 'Add amazing feature'`)\n4. Push to branch (`git push origin feature/amazing-feature`)\n5. Open Pull Request\n\n### Development Setup\n```bash\n# Install development dependencies\npip install -r requirements.txt\n\n# Install pre-commit hooks\npre-commit install\n\n# Run tests before committing\npython tests/test_keylogger.py\n```\n\n## 📄 License\n\nThe Enhanced Keylogger is released under the MIT License. The full text is provided below for convenience.\n\nMIT License\n\nCopyright (c) 2025 Enhanced Keylogger Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nThird-party licenses: This project depends on open-source libraries (e.g., pynput, cryptography, psutil, Flask, Pillow, requests, pyperclip, pywin32). Each remains under its own license; please review those projects for details.\n\n\n## ⚠️ Legal Notice\n\n**IMPORTANT**: This software is intended for educational and legitimate monitoring purposes only. Users are responsible for:\n\n- Obtaining proper consent before monitoring\n- Complying with local privacy laws\n- Using the software ethically and legally\n- Securing collected data appropriately\n\nThe developers are not responsible for misuse of this software.\n\n## 📞 Support\n\n- **Documentation**: Check this README and inline code comments\n- **Issues**: Report bugs via GitHub Issues\n- **Discussions**: Use GitHub Discussions for questions\n- **Security**: Report security issues privately\n\n## 🙏 Acknowledgments\n\n- [pynput](https://github.com/moses-palmer/pynput) for input monitoring\n- [cryptography](https://github.com/pyca/cryptography) for encryption\n- [psutil](https://github.com/giampaolo/psutil) for system monitoring\n- [Flask](https://github.com/pallets/flask) for web interface\n\n---\n\n**Remember**: Always use this software responsibly and in compliance with applicable laws and regulations.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashinno%2Fkeylogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashinno%2Fkeylogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashinno%2Fkeylogger/lists"}