This repository contains a Python script for a keylogger that captures keystrokes and sends them to a Discord channel via a webhook. The script uses the pynput
library to listen for keystrokes and requests
to send messages to Discord.
- Captures keystrokes including special keys like Ctrl, Shift, etc.
- Buffers keystrokes and sends them to Discord in batches of 100.
- Periodically sends any remaining buffered keystrokes every 5 seconds.
- Supports basic formatting for special keys like
[CTRL]
,[SHIFT]
, etc.
-
Install Dependencies: Ensure you have the required Python packages installed:
pip install -r requirements.txt
-
Configure Webhook URL: Add your Discord webhook URL to the
.env
file:WEBHOOK_URL='YOUR_DISCORD_WEBHOOK_URL_HERE'
-
Run the Script
python keylogger.py
-
Stop the Script: Use
Ctrl + C
to stop the script. It will flush any remaining buffered keystrokes before exiting.
-
Build the Docker Image
docker build -t keylogger .
-
Run the Docker Container
docker run -it --name keylogger keylogger
- Ethical Use: This script is for educational purposes only. Unauthorized use of keyloggers is illegal and unethical. Ensure you have explicit permission before running it on any machine.
- Rate Limits: Be aware of Discord rate limits. Sending too many messages quickly can cause your webhook to be rate-limited or blocked.
- Privacy: Keyloggers capture sensitive data. Use responsibly and securely handle any captured information.
- This project is licensed under the MIT License. See the LICENSE file for details.
- The authors are not responsible for any misuse of this code or damage caused.
- Use it at your own risk and comply with all applicable laws and regulations.
- For questions or feedback, please open an issue on this repository or contact the maintainer.