A lightweight keylogger project for educational and ethical penetration testing purposes. It consists of a Windows-based client that logs keystrokes and sends them to a Flask server for centralized storage and review.
keylogger-project/
├── client/
│ ├── keylogger.py # Main keylogger script
│ ├── auto_start.py # Adds the .exe to Windows startup
│ ├── remote_sender.py # Sends logs to the server
│ ├── setup_client.py # Combines all logic and sets up the client
│ └── uninstall_keylogger.py # Cleanly removes the keylogger
├── server/
│ ├── log_receiver.py # Flask server that receives logs
│ └── received_logs/ # Where received logs are stored
├── icons/
│ └── icon.ico # Optional icon for the executable
├── README.md # Project documentation
├── requirements.txt # Required Python dependencies
└── LICENSE # License information (MIT recommended)
- The keylogger logs keystrokes and saves them locally in
captured_keys.log
- Every X minutes, logs are sent via HTTP POST to the Flask server
- The server stores them in timestamped files inside
received_logs/
- Navigate to the
server/
directory. - Install dependencies:
pip install -r ../requirements.txt
- Run the server:
python log_receiver.py
- Customize
remote_sender.py
with your server IP address. - Use PyInstaller to build the keylogger:
pyinstaller --onefile --noconsole --icon=icons/icon.ico setup_client.py
- Transfer and run the
.exe
on the target Windows machine.
Run the following to remove the keylogger and all its traces:
python uninstall_keylogger.py
This project is strictly for educational use only. Unauthorized deployment of keyloggers is illegal and unethical. Always obtain proper consent.
This project is open-source and available under the MIT License.