Friday, May 6, 2016

Python Hook Keyboard

I wrote once a keylogger in C. Today I want to show you that it's also possible to Hook the Keyboard with python.
All you need is to install the pyHook package and to follow my instructions in the code.

For the package: pip --install pyHook





# author:           Marcin Cherek
# python version:   2.7.11
# Date:             12th of April 2016
# language:         English
# License:          OpenSource

from pyHook import HookManager


def OnKeyboardEvent(event):
    print(event.Ascii)


hm = HookManager()
hm.KeyDown = OnKeyboardEvent
hm.HookKeyboard()

No comments:

Post a Comment