- Install Required Libraries:
pip install keyboard-
Configure Gmail:
- Enable 2-factor authentication on your Gmail account
- Generate an App Password:
- Go to Google Account settings
- Navigate to Security → 2-Step Verification → App passwords
- Generate a new app password for "Mail."
- Use this password in the script
-
Update Configuration:
- Replace
your_email@gmail.comwith your Gmail address - Replace
your_app_passwordwith your Gmail app password - Replace
recipient@example.comwith the recipient's email address
- Replace
-
Run the Keylogger:
python keylogger.py- Logs all keystrokes, including special keys
- Sends email reports every 35 seconds
- Handles special keys (Enter, Space, Backspace, etc.)
- Threaded email sending to avoid blocking keylogging
- Shows timestamp in email reports
- Sends final report when stopped
- Permissions: On some systems, you might need to run with administrator privileges
- Gmail App Password: Use app password instead of regular Gmail password
- Email Frequency: Adjust
SEND_INTERVALto change how often emails are sent - Security: Keep your app password secure and don't commit it to version control
- Go to your Google Account
- Navigate to Security → 2-Step Verification → App passwords
- Select "Mail" as the app
- Generate the password
- Use this password in the script
This keylogger will run in the background and send email reports with all keystrokes captured during the reporting interval. The email reports include timestamps and the total number of keystrokes for easy tracking.