A Python script using pynput to log keystrokes and send data to a remote server periodically. Designed for educational purposes, use responsibly with consent.
- pynput: Monitors keyboard inputs.
- requests: Sends HTTP POST requests.
- json: Converts Python objects to JSON.
- threading: Sets up a timer for regular server posts.
- Captures keyboard inputs with
pynput, logging intext. - Handles special cases for Enter, Tab, Space, Backspace, Shift, Ctrl, and Esc keys.
- Timer function (
send_post_req) periodically sends keystrokes to the server as JSON. - Configurable server address, port, and post interval.
- Runs indefinitely, continuously capturing and posting keystrokes.
- ip_address: Set the server's IP.
- port_number: Set the server port.
- time_interval: Set post interval (seconds).
- Install dependencies:
pip install pynput requests. - Configure server details and interval.
- Run the script to capture and post keystrokes.
Educational use only. Unauthorized distribution may violate privacy and laws. Use responsibly with consent.
Exercise caution and consider ethical/legal implications associated with keylogging.