Skip to content

alihassancods/keylogger-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Keylogger Python

A simple keylogger in Python that records keystrokes, saves them to a file, and sends the log as an email attachment using SendGrid.

Features

  • Captures all keystrokes (alphanumeric and special keys).
  • Saves keystrokes to a timestamped file in a files directory.
  • Sends the log file as an email attachment via SendGrid after execution.
  • Uses environment variables for sensitive data (API keys and email addresses).

Requirements

  • Python 3.x
  • The following Python packages:
    • pynput
    • python-dotenv
    • sendgrid
  • A .env file with SendGrid API credentials and email addresses.

Setup

  1. Clone the repository:

    git clone https://github.com/alihassancods/keylogger-python.git
    cd keylogger-python
  2. Install dependencies:

    pip install pynput python-dotenv sendgrid
  3. Create a .env file in the repository root with the following variables:

    SENDGRID_API_KEY=your_sendgrid_api_key
    [email protected]
    [email protected]
    
  4. Create a files directory to store log files:

    mkdir files

Usage

Run the keylogger script:

python main.py
  • The script will start listening for keystrokes.
  • To stop logging, press the Esc key.
  • After stopping, the script will email the keystroke log file as an attachment.

How It Works

  • The Keylogger class listens for keyboard events.
  • Each keystroke is appended to a file named with the current date and time.
  • When stopped, the script encodes the log file and sends it via SendGrid.
  • Email addresses and API keys are securely loaded from the .env file.

Disclaimer

This tool is intended for educational purposes only. Do not use it to log keystrokes without the user's explicit consent. Unauthorized use may violate local laws and ethical guidelines.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages