Skip to content

Simple keylogger in Python that demonstrates keyboard event monitoring, event-driven programming, file logging and real-time key capture

Notifications You must be signed in to change notification settings

mf-rl/SimpleKeylogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Educational Keylogger

⚠️ IMPORTANT DISCLAIMER

This project is strictly for educational purposes to understand how keylogging works at a technical level.

WARNING: Using keyloggers to monitor others without explicit consent is:

  • Illegal in most jurisdictions
  • Unethical and a violation of privacy
  • Potentially subject to criminal prosecution

Only use this code on your own computer for learning purposes.

About

This is a simple keylogger implementation in Python that demonstrates:

  • Keyboard event monitoring using the pynput library
  • Event-driven programming
  • File logging
  • Real-time key capture

Features

  • Captures all keyboard input
  • Logs keystrokes to a timestamped file
  • Displays real-time key presses in the console
  • Can be stopped by pressing ESC
  • Creates organized log files in a logs/ directory

Requirements

  • Python 3.6 or higher
  • pynput library

Installation

  1. Install the required dependencies:
pip install -r requirements.txt

Usage

Run the keylogger:

python keylogger.py

To stop the keylogger, press the Ctrl+C inside the console where this script is running.

How It Works

  1. Listener Setup: Uses pynput.keyboard.Listener to monitor keyboard events
  2. Event Callbacks:
    • on_press(): Triggered when a key is pressed
    • on_release(): Triggered when a key is released
  3. Logging: All keystrokes are logged to a timestamped file with datetime stamps
  4. Graceful Exit: Press Ctrl+C to terminate the listener

Educational Value

This project helps understand:

  • Operating system event handling
  • Python's event-driven programming
  • File I/O operations
  • Security concepts and attack vectors
  • The importance of input security

About

Simple keylogger in Python that demonstrates keyboard event monitoring, event-driven programming, file logging and real-time key capture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages