def dailyemailnews_IT_noimage():
    EMAIL_USERFASTMAIL = os.environ.get('EMAIL_USERFASTMAIL')
    EMAIL_PASSWORDFASTMAIL = os.environ.get('EMAIL_PASSWORDFASTMAIL')
    users = User.query.filter_by(position="IT").all()

    for user in users:
        form = DailyNewsForm()
        title = form.title.data
        description = form.description.data
        link = form.link.data
        uniquelink = routes.createphish_token(user)

        msg = EmailMessage()
        msg['Subject'] = 'Daily Email - GamiSE'
        msg['From'] = 'GamiSE <*****@*****.**>'
        msg['To'] = user.email

        msg.add_alternative(
            """\
        <!DOCTYPE html>
            <style>
                a{
                    text-decoration:none;
                }
            </style>
            <head>
            </head>
            <table lang="en" role="presentation" aria-hidden="true" border="0" style="width: 100%;background-color: #ffffff;padding: 0px" align="center">
                <tbody>
                    <tr>
                        <td align="center" style="padding: 0px">
                            <table border="0" align="center" style="padding: 0px">
                                <tbody>
                                    <tr>
                                        <td width="12" style="padding: 0px">&nbsp; </td>
                                        <td style="padding: 0px">
                                            <table border="0" style="padding: 0px;width: 650px">
                                                <tbody>
                                                    <tr>
                                                        <td height="12" style="padding: 0px"></td>
                                                    </tr>
                                                    <tr>
                                                        <td style="text-decoration:none;width:89%;min-width:86%;display:block;font-size:28px;font-family:Helvetica,Arial,sans-serif;color:#000000;">
                                                            <strong>GamiSE</strong>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td  class = "text" style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-weight: 600;color: #292f33;font-size: 32px;line-height: 36px;padding: 0px;">Daily Email </td>
                                                    </tr>
                                                    <tr>
                                                        <br>                                               
                                                    </tr>
                                                    <tr>
                                                        <td  class = "text" style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-weight: 600;color: #292f33;font-size: 24px;line-height: 36px;padding: 0px;">Hello, """
            + user.username + """</td>
                                                    </tr>
                                                    <tr>
                                                        <br>                                               
                                                    </tr>
                                                    <tr>
                                                        <td align="center" style="padding: 0px">
                                                            <table cellpading="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                <tbody>
                                                                    <tr>
                                                                        <td style="padding: 0px;border: 1px solid #aab8c2;background-color: #ffffff;border-radius: 4px">
                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                    <tbody>
                                                                                        <tr>
                                                                                            <td style="padding: 0px">
                                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                                    <tbody>
                                                                                                        <tr>
                                                                                                            <td width="12" style="padding: 0px;width: 24px;min-width: 12px"></td>
                                                                                                            <td style="padding: 0px">
                                                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                                                    <tbody>                                                       
                                                                                                                        <tr>
                                                                                                                            <td style="text-decoration:none;width:89%;min-width:86%;display:block;font-size:28px;font-family:Helvetica,Arial,sans-serif;color:#000000;padding: 0px;">
                                                                                                                                Experience sharing:
                                                                                                                            </td>
                                                                                                                            <td style="text-decoration:none;width:89%;min-width:86%;display:block;font-size:18px;font-family:Helvetica,Arial,sans-serif;color:#000000;padding: 0px;">
                                                                                                                                Do you have any experience or defending tips that related to social engineering and want to share on the GamiSE? Feel free to share 
                                                                                                                                your experience to help others defending the attacks.
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td valign="middle" style="padding: 0px;border-radius: 100px;line-height: 18px;">
                                                                                                                            <br>
                                                                                                                                <a href="""
            + url_for('pexperience', token=uniquelink, _external=True) +
            """ style="text-align:center;width:30%;min-width:20%;display:block;font-size:18px;font-family:Helvetica,Arial,sans-serif;color:#ffffff;text-decoration:none;padding:5px 18px;border:1px solid#3071A9;background-color: #3071A9; display:inline-block;font-weight:bold;white-space:nowrap">
                                                                                                                                    Share on GamiSE 
                                                                                                                                </a>
                                                                                                                                <br><br><hr>
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="14" style="height: 14px;padding: 0px"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="text-decoration:none;width:89%;min-width:86%;display:block;font-size:28px;font-family:Helvetica,Arial,sans-serif;color:#000000;padding: 0px;">
                                                                                                                                Submit a Solution:
                                                                                                                            </td>
                                                                                                                            <td style="text-decoration:none;width:89%;min-width:86%;display:block;font-size:18px;font-family:Helvetica,Arial,sans-serif;color:#000000;padding: 0px;">
                                                                                                                                Do you have face any attacks recently, or do you find any phishing email elements in the emails that you received these days? After you forward the phishing email to the IT department,
                                                                                                                                would you like to submit a report to help the IT department to analyze the social enginering attacks?
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td valign="middle" style="padding: 0px;border-radius: 100px;line-height: 18px;">
                                                                                                                            <br>
                                                                                                                                <a href="""
            + url_for('rattack', token=uniquelink, _external=True) +
            """ style="text-align:center;width:30%;min-width:20%;display:block;font-size:18px;font-family:Helvetica,Arial,sans-serif;color:#ffffff;text-decoration:none;padding:5px 18px;border:1px solid#3071A9;background-color: #3071A9; display:inline-block;font-weight:bold;white-space:nowrap">
                                                                                                                                    Check and Solve 
                                                                                                                                </a>
                                                                                                                                <br><br><hr>
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px">
                                                                                                                                <br>
                                                                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                                                                    <tbody>
                                                                                                                                        <tr>
                                                                                                                                            <td style="text-decoration:none;width:89%;min-width:86%;display:block;font-size:28px;font-family:Helvetica,Arial,sans-serif;color:#000000;padding: 0px;">
                                                                                                                                                Social Engineering Attack News:
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td height="14" style="height: 14px;padding: 0px"></td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td height="8" style="height: 8px;padding: 0px;"></td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-size: 20px;line-height: 24px;font-weight: bold;color: #292f33;">
                                                                                                                                                """
            + title + """ </td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td height="8" style="height: 8px;padding: 0px;"></td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-size: 14px;line-height: 18px;color: #292f33;">
                                                                                                                                            """
            + description + """ </td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td height="14" style="height: 14px;padding: 0px;"></td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td style="padding: 0px;">
                                                                                                                                                <table border="0" cellspacing="0" cellpadding="0" align="left" width="100%" style="padding: 0px;">
                                                                                                                                                    <tbody>
                                                                                                                                                        <tr>
                                                                                                                                                            <td valign="middle" style="padding: 0px;border-radius: 100px;line-height: 18px;">
                                                                                                                                                                <br>
                                                                                                                                                                <a href="""
            + link +
            """ style="text-align:center;width:20%;min-width:10%;display:block;font-size:18px;font-family:Helvetica,Arial,sans-serif;color:#ffffff;text-decoration:none;padding:5px 18px;border:1px solid#3071A9;background-color: #3071A9; display:inline-block;font-weight:bold;white-space:nowrap">
                                                                                                                                                                    Read More
                                                                                                                                                                </a>
                                                                                                                                                                <br><br><hr>
                                                                                                                                                            </td>
                                                                                                                                                        </tr>
                                                                                                                                                    </tbody>
                                                                                                                                                </table>
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                    </tbody>
                                                                                                                                </table>
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                    </tbody>
                                                                                                                </table>
                                                                                                            </td>
                                                                                                            <td width="24" style="padding: 0px;width: 24px;min-width: 12px;"></td>
                                                                                                        </tr>
                                                                                                    </tbody>
                                                                                                </table>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td height="20" style="padding: 0px; height: 20px"></td>
                                                                                        </tr>
                                                                                    </tbody>
                                                                                </table>
                                                                            </a>                                   
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
        </html>
        """,
            subtype='html')

        with smtplib.SMTP_SSL('smtp.fastmail.com', 465) as smtp:
            smtp.login(EMAIL_USERFASTMAIL, EMAIL_PASSWORDFASTMAIL)
            time.sleep(2)
            smtp.send_message(msg)
            smtp.quit()
    return title, description, link
예제 #2
0
def Twitternews(userstwitter):
    title, description, links, date, image, name = NewsofCA()

    EMAIL_USERFASTMAIL = os.environ.get('EMAIL_USERFASTMAIL')
    EMAIL_PASSWORDFASTMAIL = os.environ.get('EMAIL_PASSWORDFASTMAIL')
    form = SimulationForm()
    campaign = Phishingcampaign.query.filter_by(
        campaign_name=form.campaign_name.data).first()
    for user in userstwitter:
        # news api
        inmain_url = " http://newsapi.org/v2/everything?language=en&q=" + user.interest + "&SortBy=publishedAt&apiKey=1564aed20da04500abfa72dad9b1354f "

        # fetching data in json format
        interests_news_page = requests.get(inmain_url).json()

        # getting all articles in a string article
        inarticle = interests_news_page["articles"]

        # empty list which will
        # contain all trending news
        inresults = []
        inlists = []
        inurls = []
        indate = []
        inimage = []
        inname = []

        for ar in inarticle:
            inresults.append(ar["title"])
            inlists.append(ar["description"])
            inurls.append(ar["url"])
            indate.append(ar["publishedAt"])
            inimage.append(ar["urlToImage"])
            inname.append(ar["source"])

        intitle = inresults[0]
        indescription = inlists[0]
        inlinks = inurls[0]
        indate = indate[0]
        inimage = inimage[0]
        inname = inname[0]["name"]

        # send email
        sender = 'Daily News <*****@*****.**>'
        receiver = user.email
        username = user.username
        #randomly create a token
        uniquelink = routes.createphish_token(user)

        msg = MIMEMultipart("alternative")
        msg['Subject'] = 'Hi, ' + username + '. Check Daily News'
        msg['From'] = 'Daily News <*****@*****.**>'
        msg['To'] = user.email

        html = """
        <!DOCTYPE html>
            <style>
                a{
                    text-decoration:none;
                }
            </style>
            <head>
            </head>
            <table lang="en" role="presentation" aria-hidden="true" border="0" style="width: 100%;background-color: #ffffff;padding: 0px" align="center">
                <tbody>
                    <tr>
                        <td align="center" style="padding: 0px">
                            <table border="0" align="center" style="padding: 0px">
                                <tbody>
                                    <tr>
                                        <td width="12" style="padding: 0px">&nbsp; </td>
                                        <td style="padding: 0px">
                                            <table border="0" style="padding: 0px;width: 650px">
                                                <tbody>
                                                    <tr>
                                                        <td height="12" style="padding: 0px"></td>
                                                    </tr>
                                                    <tr>
                                                        <td  class = "text" style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-weight: 600;color: #292f33;font-size: 30px;line-height: 36px;padding: 0px;">Hi, """ + username + """</td>
                                                    </tr>
                                                    <tr>
                                                        <td  class = "text" style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-weight: 600;color: #292f33;font-size: 28px;line-height: 36px;padding: 0px;">What's New </td>
                                                    </tr>
                                                    <tr>
                                                        <td height="18" style="padding: 0px"></td>                                                
                                                    </tr>
                                                    <tr>
                                                        <td align="center" style="padding: 0px">
                                                            <table cellpading="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                <tbody>
                                                                    <tr>
                                                                        <td style="padding: 0px;border: 1px solid #aab8c2;background-color: #ffffff;border-radius: 4px">
                                                                            <a href=""" + url_for(
            'trendingnews', token=uniquelink,
            _external=True) + """ title="Twitterr">
                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                    <tbody>
                                                                                        <tr>
                                                                                            <td height="24" style="padding: 9px;height: 24px"></td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td style="padding: 0px">
                                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                                    <tbody>
                                                                                                        <tr>
                                                                                                            <td width="24" style="padding: 0px;width: 24px;min-width: 12px"></td>
                                                                                                            <td style="padding: 0px">
                                                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                                                    <tbody>
                                                                                                                        <tr><img src= "https://ea.twimg.com/email/self_serve/media/logo_twitter-1497383721365.png"
                                                                                                                            height="36" alt="Twitter" title="Twitter" style="margin-left: auto;margin-right: auto;padding: 0px;display:block;border: none;outline: none;">
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <br><br>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;">
                                                                                                                                <img src = """ + image + """ width="598.89" height="399.25">
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="14" style="height: 14px;padding: 0px"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-size: 14px;line-height: 18px;color: #657786;">
                                                                                                                                """ + name + """ </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="8" style="height: 8px;padding: 0px;"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-size: 20px;line-height: 24px;font-weight: bold;color: #292f33;">
                                                                                                                            """ + title + """ </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="8" style="height: 8px;padding: 0px;"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-size: 14px;line-height: 18px;color: #292f33;">
                                                                                                                            """ + description + """ </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="14" style="height: 14px;padding: 0px;"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;">
                                                                                                                                <table border="0" cellspacing="0" cellpadding="0" align="left" width="100%" style="padding: 0px;">
                                                                                                                                    <tbody>
                                                                                                                                        <tr>
                                                                                                                                            <td align="center" valign="middle" style="padding: 0px;border-radius: 100px;line-height: 18px;">
                                                                                                                                                <a href=""" + url_for(
                'trendingnews', token=uniquelink,
                _external=True) + """ title="Twitterr"
                                                                                                                                                    style="text-decoration:none;width:89%;min-width:86%;display:block;font-size:14px;font-family:Helvetica,Arial,sans-serif;color:#ffad1f;text-decoration:none;border-radius:100px;padding:5px 18px;border:1px solid #ffad1f;display:inline-block;font-weight:bold;white-space:nowrap">
                                                                                                                                                    Read more at Twitter
                                                                                                                                                </a>
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                    </tbody>
                                                                                                                                </table>
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                    </tbody>
                                                                                                                </table>
                                                                                                            </td>
                                                                                                            <td width="24" style="padding: 0px;width: 24px;min-width: 12px;"></td>
                                                                                                        </tr>
                                                                                                    </tbody>
                                                                                                </table>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td height="20" style="padding: 0px; height: 20px"></td>
                                                                                        </tr>
                                                                                    </tbody>
                                                                                </table>
                                                                            </a>                                   
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td height="18" style="padding: 0px"></td>                                                
                                                    </tr>
                                                    <tr>
                                                        <td align="center" style="padding: 0px">
                                                            <table cellpading="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                <tbody>
                                                                    <tr>
                                                                        <td style="padding: 0px;border: 1px solid #aab8c2;background-color: #ffffff;border-radius: 4px">
                                                                            <a href=""" + url_for(
                    'trendingnews', token=uniquelink,
                    _external=True) + """ title="Twitterr">
                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                    <tbody>
                                                                                        <tr>
                                                                                            <td height="24" style="padding: 9px;height: 24px"></td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td style="padding: 0px">
                                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                                    <tbody>
                                                                                                        <tr>
                                                                                                            <td width="24" style="padding: 0px;width: 24px;min-width: 12px"></td>
                                                                                                            <td style="padding: 0px">
                                                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                                                    <tbody>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;">
                                                                                                                                <img src = """ + inimage + """ width="598.89" height="399.25">
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="14" style="height: 14px;padding: 0px"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-size: 14px;line-height: 18px;color: #657786;">
                                                                                                                                """ + inname + """ </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="8" style="height: 8px;padding: 0px;"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-size: 20px;line-height: 24px;font-weight: bold;color: #292f33;">
                                                                                                                            """ + intitle + """ </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="8" style="height: 8px;padding: 0px;"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-size: 14px;line-height: 18px;color: #292f33;">
                                                                                                                            """ + indescription + """ </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="14" style="height: 14px;padding: 0px;"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;">
                                                                                                                                <table border="0" cellspacing="0" cellpadding="0" align="left" width="100%" style="padding: 0px;">
                                                                                                                                    <tbody>
                                                                                                                                        <tr>
                                                                                                                                            <td align="center" valign="middle" style="padding: 0px;border-radius: 100px;line-height: 18px;">
                                                                                                                                                <a href=""" + url_for(
                        'trendingnews', token=uniquelink,
                        _external=True) + """ title="Twitterr"
                                                                                                                                                    style="text-decoration:none;width:89%;min-width:86%;display:block;font-size:14px;font-family:Helvetica,Arial,sans-serif;color:#ffad1f;text-decoration:none;border-radius:100px;padding:5px 18px;border:1px solid #ffad1f;display:inline-block;font-weight:bold;white-space:nowrap">
                                                                                                                                                    Read more at Twitter 
                                                                                                                                                </a>
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                    </tbody>
                                                                                                                                </table>
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                    </tbody>
                                                                                                                </table>
                                                                                                            </td>
                                                                                                            <td width="24" style="padding: 0px;width: 24px;min-width: 12px;"></td>
                                                                                                        </tr>
                                                                                                    </tbody>
                                                                                                </table>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td height="20" style="padding: 0px; height: 20px"></td>
                                                                                        </tr>
                                                                                    </tbody>
                                                                                </table>
                                                                            </a>                                   
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td style="padding:0px;margin:0px auto;font-family:'Helvetica Neue Light',Helvetica,Arial,sans-serif;font-size:12px;padding:0px;margin:0px;font-weight:normal;line-height:16px;text-align:center;margin:auto;color:#8899a6" align="center">
                                                            We sent this to """ + username + """.
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td style="padding:0px;margin:0px auto;font-family:'Helvetica Neue Light',Helvetica,Arial,sans-serif;font-size:12px;padding:0px;margin:0px;font-weight:normal;line-height:16px;text-align:center;margin:auto;color:#8899a6" align="center">
                                                            Twitter, Inc. 1355 Market Street, Suite 900 San Francisco, CA 94103.
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
        </html>
        """

        content = MIMEText(html, "html")
        msg.attach(content)

        try:
            smtpObj = SMTP_SSL('smtp.fastmail.com', 465)
            smtpObj.login(EMAIL_USERFASTMAIL, EMAIL_PASSWORDFASTMAIL)
            smtpObj.sendmail(sender, receiver, msg.as_string().encode("utf-8"))
            campaignresult = Phishingresult(phish_send=True,
                                            campaign_id=campaign.campaign_id,
                                            phish_link=uniquelink,
                                            user_id=user.id)
            db.session.add(campaignresult)
            db.session.commit()
            print("send successfully")
        except SMTPException:
            print("Error: Enable to send mail")

    return title, description, date, image, name, intitle, indescription, indate, inimage, inname, username, sender, receiver, form, campaign, uniquelink
예제 #3
0
def tablet_RBC(usersrbc):
    form = SimulationForm()
    campaign = Phishingcampaign.query.filter_by(campaign_name=form.campaign_name.data).first()
    for user in usersrbc:
        sender = 'RBC <*****@*****.**>'
        receiver = [user.email]
        username = user.username
        #randomly create a token
        uniquelink = routes.createphish_token(user)

        EMAIL_USERFASTMAIL = os.environ.get('EMAIL_USERFASTMAIL')
        EMAIL_PASSWORDFASTMAIL = os.environ.get('EMAIL_PASSWORDFASTMAIL')
        msg = MIMEMultipart("alternative")
        msg['Subject'] = 'RBC - Limited Time, Chance to get a Tabllet!'
        msg['From'] = 'RBC <*****@*****.**>'
        msg['To'] = user.email

        html = """
        <!DOCTYPE html >
        <html lang="en-GB">
            <head>
                <meta http-equiv=Content-Type content="text/html; charset=UTF-8">
                <style type="text/css">
                body,td,div,p,a,input 
                {
                    font-family: arial, sans-serif;
                }
                </style>
                <meta http-equiv="X-UA-Compatible" content="IE=edge">
                <style type="text/css">
                body, td 
                {
                    font-size:13px
                } 
                a:link, a:active 
                {
                    color:#1155CC; 
                    text-decoration:none
                } 
                a:hover 
                {
                    text-decoration:underline; 
                    cursor: pointer
                } 
                a:visited
                {
                    color:#6611CC
                }
                img
                {
                    border:0px
                } 
                pre 
                { 
                    white-space: pre; 
                    white-space: -moz-pre-wrap; 
                    white-space: -o-pre-wrap; 
                    white-space: pre-wrap; 
                    word-wrap: break-word; 
                    max-width: 800px; 
                    overflow: auto;
                }
                .logo 
                { 
                    left: -7px; 
                    position: relative; 
                }
                .ribbon 
                {
                display: inline-block;
                height: 0;
                padding: 0 7.5px;
                line-height: 0.15rem;
                font-size: 24px;
                background-color: #ffc400;
                border-top: 18px solid #ffc400;border-bottom: 18px solid #ffc400;
                border-right: 11px solid #fff;
                }
                </style>
            </head>
            <body>
                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0" style="margin:0px auto;background-color:rgb(230,230,230)" bgcolor="#e6e6e6">
                    <tbody>
                        <tr>
                            <td valign="top" align="center" style="background-color:rgb(230,230,230)" bgcolor="#e6e6e6">
                                <table cellpadding="0" cellspacing="0" width="600" align="center" border="0" style="margin:0px auto;width:100%;max-width:600px">
                                    <tbody>
                                        <tr>
                                            <br><br>
                                        </tr>
                                        <tr>
                                            <td valign="top" style="font-size:0px;background-color:rgb(230,230,230)" bgcolor="#e6e6e6">
                                                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0" style="width:100%;max-width:600px">
                                                    <tbody>
                                                        <tr>
                                                            <td valign="top" style="padding:10px 20px;text-align:left;background-color:rgb(0,106,195)" bgcolor="#006ac3">
                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""" style="border:0px">
                                                                    <img src="https://image.website.rbc.com/lib/fe921570736c0c7b75/m/11/507ca2e3-a774-4584-b28a-e18ab9cd7dcc.jpg" width="150" alt="Royal Bank" style="border-width:0px;width:150px;max-width:150px;height:auto">
                                                                </a>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0">
                                                    <tbody>
                                                        <tr>
                                                            <td valign="top" bgcolor="#ffffff" style="font-size:0px;text-align:center;background-color:rgb(255,255,255)">
                                                                <table cellpadding="0" cellspacing="0" width="260" border="0">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td valign="top" style="padding:30px 0px 0px;background-color:rgb(255,255,255);">
                                                                                <div class="ribbon text-script">Limited Time Offer</div>
                                                                            </td>
                                                                        </tr>
                                                                </table>
                                                                <table cellpadding="0" cellspacing="0" width="260" align="center" border="0">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td valign="top" style="padding:20px 0px 30px;background-color:rgb(255,255,255)">
                                                                                <img src="https://image.website.rbc.com/lib/fe921570736c0c7b75/m/11/04a1d4c5-3084-4f15-b0c3-7a63868e8bc4.jpg" width="260" alt="iPad" style="border:0px;width:100%;max-width:260px;height:auto">
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0">
                                                    <tbody>
                                                        <tr>
                                                            <td valign="top" style="padding:0px 20px 20px;text-align:center;background-color:rgb(255,255,255);color:rgb(0,0,0)" bgcolor="#ffffff;">
                                                                <h1 style="text-align:center;margin:0px;font-size:24px;font-family:Roboto,Arial,sans-serif;color:rgb(0,0,0)">
                                                                    <strong style="font-family:Roboto,Arial,sans-serif">Get the Latest 10.2” iPad in Your <br>Choice of Colour at No Cost.</strong>
                                                                </h1>
                                                                <p>When you open an eligible RBC bank account.
                                                                </p>
                                                                <p>
                                                                    Offer ends June 30, 2021. Conditions apply.
                                                                </p>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0">
                                                    <tbody>
                                                        <tr>
                                                            <td valign="top" style="background-color:rgb(255,255,255)" bgcolor="#ffffff">
                                                                <table cellpadding="0" cellspacing="0" width="15%" align="center" border="0">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td valign="top" style="padding-top:0px;padding-bottom:30px;border-top-width:1px;border-top-style:solid;font-size:10px;border-top-color:rgb(0,106,195)">
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0">
                                                    <tbody>
                                                        <tr>
                                                            <td valign="top" style="padding:0px 20px 0px;text-align:left;background-color:rgb(255,255,255);color:rgb(0,0,0)">
                                                                <p style="margin:0px 0px 20px;font-family:Roboto,Arial,sans-serif;font-size:18px;line-height:24px">
                                                                    Hello """+ username +""",
                                                                </p>
                                                                <p style="margin:0px 0px 20px;font-size:18px;line-height:24px;font-family:Roboto,Arial,sans-serif">
                                                                    <strong>How To Get Started</strong>
                                                                </p>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0">
                                                    <tbody>
                                                        <tr>
                                                            <td valign="top" style="padding:0px 20px;text-align:left;background-color:rgb(255,255,255);color:rgb(0,0,0)" bgcolor="#ffffff;">
                                                                <table cellpadding="0" cellspacing="0" width="90%" align="center" border="0">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td valign="top" style="font-size:24px;line-height:24px;padding-right:15px;color:rgb(0,106,195)">
                                                                                <img src="https://www.rbcroyalbank.com/dms/pba/open-an-account/_assets-custom/images/1-transparent.png" alt="1" style="width: 30px !important;">
                                                                            </td>
                                                                            <td valign="top" style="font-family:Roboto,Arial,sans-serif;font-size:16px;line-height:24px">
                                                                                Open an eligible RBC bank account by 
                                                                                <Strong>
                                                                                    December 18, 2021
                                                                                </Strong><br>
                                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""" style="font-family:Roboto,Arial,sans-serif;color:rgb(0,106,195)" title="RBC chance to get a tablet">
                                                                                    <strong style="font-family:Roboto,Arial,sans-serif;color:rgb(0,106,195);"> > Get Started</strong>
                                                                                </a> 
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td valign="top" colspan="2" style="padding-bottom:10px">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td valign="top" style="font-size:24px;line-height:24px;padding-right:15px;color:rgb(0,106,195)">
                                                                                <img src="https://www.rbcroyalbank.com/dms/pba/open-an-account/_assets-custom/images/2-transparent.png" alt="2" style="width: 30px !important;">
                                                                            </td>
                                                                            <td valign="top" style="font-family:Roboto,Arial,sans-serif;font-size:16px;line-height:24px">
                                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""" style="font-family:Roboto,Arial,sans-serif;color:rgb(0,106,195)" title="RBC chance to get a tablet">
                                                                                    <strong style="font-family:Roboto,Arial,sans-serif;color:rgb(0, 0, 0)">Set up and complete two of the following by June 30, 2021:</strong>
                                                                                </a>
                                                                                <li style="color: rgb(0,106,195);">
                                                                                    <span style="color:rgb(0, 0, 0)">
                                                                                        Your payroll as a direct deposit
                                                                                    </span>
                                                                                </li>
                                                                                <li style="color: rgb(0,106,195);">
                                                                                    <span style="color:rgb(0, 0, 0)">
                                                                                        Two pre-authorized monthly payments (PAPs)
                                                                                    </span>
                                                                                </li>
                                                                                <li style="color: rgb(0,106,195);">
                                                                                    <span style="color:rgb(0, 0, 0)">
                                                                                        Two bill payments to a service provider
                                                                                    </span>
                                                                                </li>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td valign="top" style="font-size:24px;line-height:24px;padding-right:15px;color:rgb(0,106,195)">
                                                                                <img src="https://www.rbcroyalbank.com/dms/pba/open-an-account/_assets-custom/images/3-transparent.png" alt="3" style="width: 30px !important;">
                                                                            </td>
                                                                            <td valign="top" style="font-family:Roboto,Arial,sans-serif;font-size:16px;line-height:24px">
                                                                                We’ll send you an email shortly after you qualify with instructions on how to order your 
                                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""" style="font-family:Roboto,Arial,sans-serif;color:rgb(0,106,195)" title="RBC chance to get a tablet">10.2”  iPad Wi-Fi 32GB (8th Generation)</a>. 
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0">
                                                    <tbody>
                                                        <tr>
                                                            <td valign="top" style="padding:20px 20px 60px;text-align:left;background-color:rgb(255,255,255);color:rgb(0,0,0)" bgcolor="#ffffff;">
                                                            <br><br>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <table align="center" cellpadding="0" cellspacing="0" border="0" style="border-spacing:0px;margin:0px auto;width:100%;max-width:600px" bgcolor="#e6e6e6">
                                                    <tbody>
                                                        <tr>
                                                            <td style="padding:0px">
                                                                <table cellpadding="0" cellspacing="0" width="600" align="center" border="0" style="width:100%;max-width:600px">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td valign="middle" style="font-size:0px;padding-bottom:0px;padding-top:0px;border-top-width:1px;border-top-style:solid;text-align:center;background-color:rgb(230,230,230);border-top-color:rgb(153,153,153)" bgcolor="#e6e6e6">
                                                                                <table cellpadding="0" cellspacing="0" border="0" style="display:inline-block;vertical-align:middle">
                                                                                    <tbody>
                                                                                        <tr>
                                                                                            <td style="padding:10px 20px">
                                                                                                <table align="center" cellspacing="0" width="240" cellpadding="0" border="0">
                                                                                                    <tbody>
                                                                                                        <tr>
                                                                                                            <td align="center" valign="middle">
                                                                                                                <span style="font-size:14px;font-family:Arial,sans-serif,Roboto;font-style:italic;color:rgb(0,0,0)">
                                                                                                                    Join us / 
                                                                                                                </span>
                                                                                                            </td>
                                                                                                            <td align="center" valign="middle" style="padding-left:10px">
                                                                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""">
                                                                                                                    <img src="https://image.website.rbc.com/lib/fe921570736c0c7b75/m/9/7e0e5a9b-eedf-495b-8782-164ce8343873.jpg" width="32" alt="RBC on Facebook" style="border-width:0px;margin:0px auto;display:inline-block;vertical-align:middle">
                                                                                                                </a>
                                                                                                            </td>
                                                                                                            <td align="center" valign="middle" style="padding-left:10px">
                                                                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""">
                                                                                                                    <img src="https://image.website.rbc.com/lib/fe921570736c0c7b75/m/9/4dba4ecc-ca13-4f88-8279-315f6fd0fde5.jpg" width="32" alt="RBC on Twitter" style="border-width:0px;margin:0px auto;display:inline-block;vertical-align:middle">
                                                                                                                </a>
                                                                                                            </td>
                                                                                                            <td align="center" valign="middle" style="padding-left:10px">
                                                                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""">
                                                                                                                    <img src="https://image.website.rbc.com/lib/fe921570736c0c7b75/m/9/846c8f41-494f-4a5f-bfaf-6cc990f06e00.jpg" width="32" alt="RBC on YouTube" style="border-width:0px;margin:0px auto;display:inline-block;vertical-align:middle">
                                                                                                                </a>
                                                                                                            </td>
                                                                                                            <td align="center" valign="middle" style="padding-left:10px">
                                                                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""">
                                                                                                                    <img src="https://image.website.rbc.com/lib/fe921570736c0c7b75/m/9/f2d5f73f-857d-4599-ae5c-e08a2eb7bb69.jpg" width="32" alt="RBC on LinkedIn" style="border-width:0px;margin:0px auto;display:inline-block;vertical-align:middle">
                                                                                                                </a>
                                                                                                            </td>
                                                                                                        </tr>
                                                                                                    </tbody>
                                                                                                </table>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </tbody>
                                                                                </table>
                                                                                <table cellpadding="0" cellspacing="0" border="0" style="display:inline-block;vertical-align:middle">
                                                                                    <tbody>
                                                                                        <tr>
                                                                                            <td style="padding:10px 0px;text-align:center">
                                                                                                <table align="center" width="300" cellpadding="0" border="0" style="width:300px">
                                                                                                    <tbody>
                                                                                                        <tr>
                                                                                                            <td align="center" valign="middle" style="text-align:right">
                                                                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""" style="text-decoration:none;border:0px">
                                                                                                                    <img src="https://image.website.rbc.com/lib/fe921570736c0c7b75/m/11/69965cc7-321d-4637-9e26-6340df3c6acf.png" width="120" alt="Download on the App Store" title="Download on the App Store" style="border-width:0px;margin:0px auto;display:inline-block;vertical-align:middle">
                                                                                                                </a>
                                                                                                            </td>
                                                                                                            <td width="20"></td>
                                                                                                            <td align="center" valign="middle" style="text-align:left">
                                                                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""" style="text-decoration:none;border:0px">
                                                                                                                    <img src="https://image.website.rbc.com/lib/fe921570736c0c7b75/m/11/ecab41a9-a95e-42d7-8c73-82b974be6a33.png" width="130" alt="Get it on Google Play" title="Get it on Google Play" style="border-width:0px;margin:0px auto;display:inline-block;vertical-align:middle">
                                                                                                                </a>
                                                                                                            </td>
                                                                                                        </tr>
                                                                                                    </tbody>
                                                                                                </table>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </tbody>
                                                                                </table>
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                                <table border="0" cellspacing="0" cellpadding="0" align="center" width="100%" bgcolor="#e6e6e6">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td style="border-top-width:1px;border-top-style:solid;padding:15px 20px;border-bottom-width:1px;border-bottom-style:solid;text-align:left;font-size:12px;font-family:Arial,sans-serif,Roboto;line-height:18px;border-top-color:rgb(153,153,153);border-bottom-color:rgb(153,153,153);color:rgb(0,106,195)">
                                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""" style="text-decoration:underline;font-family:Arial,sans-serif,Roboto;color:rgb(0,106,195)" title="Privacy &amp; Security">
                                                                                    Privacy &amp; Security
                                                                                </a> 
                                                                                | 
                                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""" style="text-decoration:underline;font-family:Arial,sans-serif,Roboto;color:rgb(0,106,195)" title="Legal">
                                                                                    Legal
                                                                                </a> 
                                                                                | 
                                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""" style="text-decoration:underline;font-family:Arial,sans-serif,Roboto;color:rgb(0,106,195)" title="Unsubscribe">
                                                                                    Unsubscribe
                                                                                </a>
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                                <table border="0" cellspacing="0" cellpadding="0" align="center" width="100%" bgcolor="#e6e6e6">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td width="36" valign="top" bgcolor="#e6e6e6" style="text-align:left;padding-left:20px;padding-right:6px;padding-top:15px;line-height:16px;font-family:Arial,sans-serif;font-size:11px;color:rgb(0,0,0)"> 
                                                                            </td>
                                                                            <td valign="top" style="text-align:left;padding-right:20px;padding-top:15px;padding-bottom:6px;font-family:Arial,sans-serif;font-size:11px;line-height:16px;color:rgb(0,0,0)">
                                                                                <table cellpadding="0" cellspacing="0" width="100%" style="min-width:100%;font-family:Arial,sans-serif">
                                                                                    <tbody style="font-family:Arial,sans-serif">
                                                                                        <tr style="font-family:Arial,sans-serif">
                                                                                            <td style="font-family:Arial,sans-serif">
                                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="font-family:Arial,sans-serif">
                                                                                                    <tbody style="font-family:Arial,sans-serif"><tr style="font-family:Arial,sans-serif">
                                                                                                        <tr>
                                                                                                            <td style="font-family:Arial,sans-serif;font-size:11px;line-height:16px;color:rgb(0,0,0)">
                                                                                                                RBC Royal Bank | Royal Bank of Canada
                                                                                                                <br>
                                                                                                                RBC WaterPark Place, 
                                                                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""" style="font-family:Arial,sans-serif;color:rgb(0,106,195)">
                                                                                                                    150 Queens Quay West, 12th Floor, Toronto, ON
                                                                                                                </a>
                                                                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""" style="font-family:Arial,sans-serif;color:rgb(0,106,195)">
                                                                                                                    , M5J 0B8, Canada
                                                                                                                </a> 
                                                                                                                <br>
                                                                                                                <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""" style="text-decoration:underline;font-family:Arial,sans-serif;color:rgb(0,106,195)" title="www.rbcroyalbank.com">
                                                                                                                </a>
                                                                                                                    www.rbcroyalbank.com
                                                                                                                </a>
                                                                                                            </td>
                                                                                                        </tr>
                                                                                                    </tbody>
                                                                                                </table>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </tbody>
                                                                                </table>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td width="36" valign="top" bgcolor="#e6e6e6" style="text-align:left;padding-left:20px;padding-right:6px;font-family:Arial,sans-serif;font-size:11px;line-height:16px;color:rgb(0,0,0)">
                                                                                ®/™
                                                                            </td>
                                                                            <td valign="top" style="text-align:left;padding-right:20px;font-family:Arial,sans-serif;font-size:11px;line-height:16px;padding-bottom:6px;color:rgb(0,0,0)">
                                                                                <p style="margin:0px;padding:0px;font-size:11px;line-height:16px;font-family:Arial,sans-serif">
                                                                                    Trademark(s) of Royal Bank of Canada. RBC and Royal Bank are registered trademarks of Royal Bank of Canada.
                                                                                </p>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td width="36" valign="top" bgcolor="#e6e6e6" style="text-align:left;padding-left:20px;padding-right:6px;font-family:Arial,sans-serif;font-size:11px;line-height:16px;color:rgb(0,0,0)">
                                                                                ©
                                                                            </td>
                                                                            <td valign="top" style="text-align:left;padding-right:20px;font-family:Arial,sans-serif;font-size:11px;line-height:16px;padding-bottom:6px;color:rgb(0,0,0)">
                                                                                Royal Bank of Canada 2019 
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td width="36" valign="top" bgcolor="#e6e6e6" style="text-align:left;padding-left:20px;padding-right:6px;font-family:Arial,sans-serif;font-size:11px;line-height:16px;color:rgb(0,0,0)">
                                                                                *
                                                                            </td>
                                                                            <td valign="top" style="text-align:left;padding-right:20px;font-family:Arial,sans-serif;font-size:11px;line-height:16px;padding-bottom:6px;color:rgb(0,0,0)">
                                                                                <p style="margin:0px;padding:0px;font-size:11px;line-height:16px;font-family:Arial,sans-serif">
                                                                                    This offer is available to permanent Canadian residents without an existing Personal Banking Account with Royal Bank of Canada or any of its deposit taking subsidiaries at the beginning of the “Promotional Period” on May 21, 2021, 
                                                                                    or in the prior five year period, and otherwise comply with the terms of the offer. 
                                                                                    You will be eligible to receive a complimentary Apple iPad, when you open your first new Eligible Personal Banking Account of either an RBC Signature No Limit Banking® account (monthly fee of $15.95) or RBC VIP Banking® account (monthly fee of $30) 
                                                                                    by 9PM EST September 3, 2021 and complete two of the following ”Qualifying Criteria” by 9PM EST June 30, 2021: set up two pre-authorized payments from the Eligible Personal Banking Account; and/or one automated and recurring payroll or pension direct deposit to the Eligible Personal Banking Account, 
                                                                                    and/or two bill payments to a service provider from the Eligible Personal Banking Account. RBC has the right to determine what is considered payroll. To qualify you must be of the age of majority in the province or territory in which you reside by June 30, 2021. This offer may not be combined or used in conjunction with any other Personal Banking Account offers unless otherwise indicated. 
                                                                                    Royal Bank of Canada reserves the right to withdraw this offer at any time without notice, even after acceptance by you. Other conditions apply. For full details including defined terms visit 
                                                                                    <a href="""+ url_for('check_phishlink', token=uniquelink, _external=True) +""" style="font-family:Arial,sans-serif;color:rgb(0,0,0)">
                                                                                        <span style="font-family:Arial,sans-serif;color:rgb(0,0,0)">www.rbc.com/termsandconditions
                                                                                        </span>
                                                                                    </a>
                                                                                    <wbr>.
                                                                                </p>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td width="36" valign="top" bgcolor="#e6e6e6" style="text-align:left;padding-left:20px;padding-right:6px;font-family:Arial,sans-serif;font-size:11px;line-height:16px;color:rgb(0,0,0)">
                                                                                1
                                                                            </td>
                                                                            <td valign="top" style="text-align:left;padding-right:20px;font-family:Arial,sans-serif;font-size:11px;line-height:16px;padding-bottom:6px;color:rgb(0,0,0)">
                                                                                <p style="margin:0px;padding:0px;font-size:11px;line-height:16px;font-family:Arial,sans-serif">
                                                                                    RBC Mobile and RBC Online Banking are operated by Royal Bank of Canada, RBC Direct Investing Inc. and RBC Dominion Securities Inc.
                                                                                </p>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td style="text-align:left;padding-left:32px;padding-right:20px;padding-bottom:12px;line-height:16px" colspan="2">
                                                                            </td>
                                                                        </tr> 
                                                                    </tbody>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </body>
        </html>
        
                    
                                                            
                                                
        """

        content = MIMEText(html, "html")
        msg.attach(content)

        try:
            smtpObj = SMTP('smtp.fastmail.com', 465)
            smtpObj.login(EMAIL_USERFASTMAIL, EMAIL_PASSWORDFASTMAIL)
            smtpObj.sendmail(sender, receiver, msg.as_string().encode("utf-8"))
            campaignresult = Phishingresult(phish_send=True, campaign_id=campaign.campaign_id, phish_link = uniquelink, user_id=user.id)
            db.session.add(campaignresult)
            db.session.commit()
            print ("send successfully")
        except SMTPException:
            print ("Error: Enable to send mail")
    return sender, receiver, username, form, campaign, uniquelink
예제 #4
0
def tablet_TD(userstd):
    EMAIL_USERFASTMAIL = os.environ.get('EMAIL_USERFASTMAIL')
    EMAIL_PASSWORDFASTMAIL = os.environ.get('EMAIL_PASSWORDFASTMAIL')
    form = SimulationForm()
    campaign = Phishingcampaign.query.filter_by(
        campaign_name=form.campaign_name.data).first()
    for user in userstd:
        sender = 'TD <*****@*****.**>'
        receiver = user.email
        username = user.username
        #randomly create a token
        uniquelink = routes.createphish_token(user)

        msg = MIMEMultipart("mixed")
        msg['Subject'] = 'TD - Limited Time, Chance to get a Tabllet'
        msg['From'] = 'TD <*****@*****.**>'
        msg['To'] = user.email

        html = """


        <!DOCTYPE html>
        <html lang="en-GB">
            <head>
                <meta http-equiv=Content-Type content="text/html; charset=UTF-8">
                <style type="text/css">
                body,td,div,p,a,input 
                {
                    font-family: arial, sans-serif;
                }
                </style>
                <meta http-equiv="X-UA-Compatible" content="IE=edge">
                <style type="text/css">
                body, td 
                {
                    font-size:13px
                } 
                a:link, a:active 
                {
                    color:#1155CC; 
                    text-decoration:none
                } 
                a:hover 
                {
                    text-decoration:underline; 
                    cursor: pointer
                } 
                a:visited
                {
                    color:#6611CC
                }
                img
                {
                    border:0px
                } 
                pre 
                { 
                    white-space: pre; 
                    white-space: -moz-pre-wrap; 
                    white-space: -o-pre-wrap; 
                    white-space: pre-wrap; 
                    word-wrap: break-word; 
                    max-width: 800px; 
                    overflow: auto;
                }
                .logo 
                { 
                    left: -7px; 
                    position: relative; 
                }
                .ribbon 
                {
                display: inline-block;
                height: 0;
                padding: 0 7.5px;
                line-height: 0.15rem;
                font-size: 24px;
                background-color: #ffc400;
                border-top: 18px solid #ffc400;border-bottom: 18px solid #ffc400;
                border-right: 11px solid #fff;
                }
                </style>
            </head>
            <body>
                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0" style="margin:0px auto;background-color:rgb(230,230,230)" bgcolor="#e6e6e6">
                    <tbody>
                        <tr>
                            <td valign="top" align="center" style="background-color:rgb(230,230,230)" bgcolor="#e6e6e6">
                                <table cellpadding="0" cellspacing="0" width="600" align="center" border="0" style="margin:0px auto;width:100%;max-width:600px">
                                    <tbody>
                                        <tr>
                                            <br><br>
                                        </tr>
                                        <tr>
                                            <td valign="top" style="font-size:0px;background-color:rgb(230,230,230)" bgcolor="#e6e6e6">
                                                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0" style="width:100%;max-width:600px">
                                                    <tbody>
                                                        <tr>
                                                            <td valign="top" style="padding:10px 20px;text-align:left;background-color:#1a5336" bgcolor="#006ac3">
                                                                <a href=""" + url_for(
            'check_phishlink', token=uniquelink, _external=True
        ) + """ style="border:0px">
                                                                    <img src="https://image.e.email-td.com/lib/fe9a12747762077d75/m/1/1d074aee-2f1e-446d-bac5-ccc9a88e41d7.png" width="150" alt="TD" style="border-width:0px;width:67px;max-width:150px;height:60px">
                                                                </a>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0">
                                                    <tbody>
                                                        <tr>
                                                            <td valign="top" bgcolor="#ffffff" style="font-size:0px;text-align:center;background-color:rgb(255,255,255)">
                                                                <table cellpadding="0" cellspacing="0" width="260" border="0">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td valign="top" style="padding:30px 0px 0px;background-color:rgb(255,255,255);">
                                                                                <div class="ribbon text-script">Limited Time Offer</div>
                                                                            </td>
                                                                        </tr>
                                                                </table>
                                                                <table cellpadding="0" cellspacing="0" width="260" align="center" border="0">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td valign="top" style="padding:20px 0px 30px;background-color:rgb(255,255,255)">
                                                                                <img src="https://image.website.rbc.com/lib/fe921570736c0c7b75/m/11/04a1d4c5-3084-4f15-b0c3-7a63868e8bc4.jpg" width="260" alt="iPad" style="border:0px;width:100%;max-width:260px;height:auto">
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0">
                                                    <tbody>
                                                        <tr>
                                                            <td valign="top" style="padding:0px 20px 20px;text-align:center;background-color:rgb(255,255,255);color:rgb(0,0,0)" bgcolor="#ffffff;">
                                                                <h1 style="text-align:center;margin:0px;font-size:24px;font-family:Roboto,Arial,sans-serif;color:rgb(0,0,0)">
                                                                    <strong style="font-family:Roboto,Arial,sans-serif">Get the Latest 10.2” iPad in Your <br>Choice of Colour at No Cost.</strong>
                                                                </h1>
                                                                <p>When you open an eligible TD bank account.
                                                                </p>
                                                                <p>
                                                                    Offer ends June 30, 2021. Conditions apply.
                                                                </p>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0">
                                                    <tbody>
                                                        <tr>
                                                            <td valign="top" style="background-color:rgb(255,255,255)" bgcolor="#ffffff">
                                                                <table cellpadding="0" cellspacing="0" width="15%" align="center" border="0">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td valign="top" style="padding-top:0px;padding-bottom:30px;border-top-width:1px;border-top-style:solid;font-size:10px;border-top-color:#008a00">
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0">
                                                    <tbody>
                                                        <tr>
                                                            <td valign="top" style="padding:0px 20px 0px;text-align:left;background-color:rgb(255,255,255);color:rgb(0,0,0)">
                                                                <p style="margin:0px 0px 20px;font-family:Roboto,Arial,sans-serif;font-size:18px;line-height:24px">
                                                                    Hello """ + username + """,
                                                                </p>
                                                                <p style="margin:0px 0px 20px;font-size:18px;line-height:24px;font-family:Roboto,Arial,sans-serif">
                                                                    <strong>How To Get Started</strong>
                                                                </p>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0">
                                                    <tbody>
                                                        <tr>
                                                            <td valign="top" style="padding:0px 20px;text-align:left;background-color:rgb(255,255,255);color:rgb(0,0,0)" bgcolor="#ffffff;">
                                                                <table cellpadding="0" cellspacing="0" width="90%" align="center" border="0">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td valign="top" style="font-size:24px;line-height:24px;padding-right:15px;color:#008a00">
                                                                                <strong>1</strong>
                                                                            </td>
                                                                            <td valign="top" style="font-family:Roboto,Arial,sans-serif;font-size:16px;line-height:24px">
                                                                                Open an eligible TD bank account by 
                                                                                <Strong>
                                                                                    June 30, 2021
                                                                                </Strong><br>
                                                                                <a href=""" + url_for(
            'check_phishlink', token=uniquelink, _external=True
        ) + """ style="font-family:Roboto,Arial,sans-serif;color:rgb(0,106,195); text-decoration:none" title="TD chance to get a tablet">
                                                                                    <strong style="font-family:Roboto,Arial,sans-serif;color:#008a00;">> Get Started</strong>
                                                                                </a> 
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td valign="top" colspan="2" style="padding-bottom:10px">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td valign="top" style="font-size:24px;line-height:24px;padding-right:15px;color:#008a00">
                                                                                <strong>2</strong>
                                                                            </td>
                                                                            <td valign="top" style="font-family:Roboto,Arial,sans-serif;font-size:16px;line-height:24px;">
                                                                                <a href=""" + url_for(
            'check_phishlink', token=uniquelink, _external=True
        ) + """ style="font-family:Roboto,Arial,sans-serif;color:rgb(0,106,195);text-decoration:none" title="TD chance to get a tablet">
                                                                                    <strong style="font-family:Roboto,Arial,sans-serif;color:rgb(0, 0, 0)">Set up and complete two of the following by June 30, 2021:</strong>
                                                                                </a>
                                                                                <li style="color: #008a00;">
                                                                                    <span style="color:rgb(0, 0, 0)">
                                                                                        Your payroll as a direct deposit
                                                                                    </span>
                                                                                </li>
                                                                                <li style="color: #008a00;">
                                                                                    <span style="color:rgb(0, 0, 0)">
                                                                                        Two pre-authorized monthly payments (PAPs)
                                                                                    </span>
                                                                                </li>
                                                                                <li style="color: #008a00;">
                                                                                    <span style="color:rgb(0, 0, 0)">
                                                                                        Two bill payments to a service provider
                                                                                    </span>
                                                                                </li>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td valign="top" style="font-size:24px;line-height:24px;padding-right:15px;color:#008a00">
                                                                                <strong>3</strong>
                                                                            </td>
                                                                            <td valign="top" style="font-family:Roboto,Arial,sans-serif;font-size:16px;line-height:24px">
                                                                                We’ll send you an email shortly after you qualify with instructions on how to order your 
                                                                                <a href=""" + url_for(
            'check_phishlink', token=uniquelink, _external=True
        ) + """ style="font-family:Roboto,Arial,sans-serif;color:#008a00;text-decoration:none" title="TD chance to get a tablet">10.2”  iPad Wi-Fi 32GB (8th Generation)</a>. 
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0">
                                                    <tbody>
                                                        <tr>
                                                            <td valign="top" style="padding:20px 20px 60px;text-align:left;background-color:rgb(255,255,255);color:rgb(0,0,0)" bgcolor="#ffffff;">
                                                            <br><br>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <table align="center" cellpadding="0" cellspacing="0" border="0" style="border-spacing:0px;margin:0px auto;width:100%;max-width:600px" bgcolor="#e6e6e6">
                                                    <tbody>
                                                        <tr>
                                                            <td style="padding:0px">
                                                                <table cellpadding="0" cellspacing="0" width="600" align="center" border="0" style="width:100%;max-width:600px">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td valign="middle" style="font-size:0px;padding-bottom:0px;padding-top:0px;border-top-width:1px;border-top-style:solid;text-align:center;background-color:rgb(230,230,230);border-top-color:rgb(153,153,153)" bgcolor="#e6e6e6">
                                                                                <table cellpadding="0" cellspacing="0" border="0" style="display:inline-block;vertical-align:middle">
                                                                                    <tbody>
                                                                                        <tr>
                                                                                            <td style="padding:0px 0px">
                                                                                                <table align="center" cellspacing="0" width="240" cellpadding="0" border="0">
                                                                                                    <tbody>
                                                                                                        <tr>
                                                                                                            <td bgcolor="#1a5336" valign="top" align="center" style="border-collapse:collapse">
                                                                                                                <table valign="middle" width="600" style="border-collapse:collapse;border-collapse:collapse;color:#ffffff;font-size:16px;font-family:Arial,Helvetica,sans-serif;text-align:left;padding-right:55px">
                                                                                                                    <tbody>
                                                                                                                        <tr>
                                                                                                                            <td align="center" valign="middle" style="border-collapse:collapse;padding-left:30px" >
                                                                                                                                <img alt="" width="124" border="0" style="display:block;max-width:124px;margin-left:20px;min-width:75px" src="https://image.e.email-td.com/lib/fe9a12747762077d75/m/1/bc1dfdea-b315-492b-ac21-e9c1726b80ef.png">
                                                                                                                            </td>
                                                                                                                            <td valign="middle" style="border-collapse:collapse;border-collapse:collapse;color:#ffffff;font-size:16px;font-family:Arial,Helvetica,sans-serif;text-align:left;padding-right:55px;padding-left: 20px;">
                                                                                                                                <span style="white-space:nowrap">
                                                                                                                                    <a href=""" + url_for(
            'check_phishlink', token=uniquelink, _external=True
        ) + """ style="color:inherit;color:#ffffff;text-decoration:underline" title="Contact Us">
                                                                                                                                        Contact Us
                                                                                                                                    </a> 
                                                                                                                                    <span> </span>
                                                                                                                                    |<span> </span>
                                                                                                                                </span>
                                                                                                                                <span style="white-space:nowrap">
                                                                                                                                    <a href=""" + url_for(
            'check_phishlink', token=uniquelink, _external=True
        ) + """ style="color:inherit;color:#ffffff;text-decoration:underline" title="Privacy and Security">
                                                                                                                                        Privacy and Security
                                                                                                                                    </a> 
                                                                                                                                    <span> </span>
                                                                                                                                    |
                                                                                                                                    <span> </span>
                                                                                                                                </span>
                                                                                                                                <a href=""" + url_for(
            'check_phishlink', token=uniquelink, _external=True
        ) + """ style="color:inherit;color:#ffffff;text-decoration:underline" title="Legal">
                                                                                                                                    Legal
                                                                                                                                </a>
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                    </tbody>
                                                                                                                </table>
                                                                                                            </td>
                                                                                                        </tr>
                                                                                                    </tbody>
                                                                                                </table>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </tbody>
                                                                                </table>
                                                                                <table border="0" cellspacing="0" cellpadding="0" align="center" width="100%" bgcolor="#e6e6e6">
                                                                                    <tbody>
                                                                                        <tr>
                                                                                            <td valign="top" align = "left" style="border-collapse:collapse;font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:14px;color:#555555;padding-top:11px; border-bottom:1px solid #a7a7a7">
                                                                                                <br>
                                                                                                    Safeguarding our customers’ information is a fundamental principle of TD Bank Group. For security reasons, certain information including account number has been masked. 
                                                                                                    TD will not ask you to provide personal information or login information, such as username, passwords, PINs, IdentificationPlus
                                                                                                <sup style="line-height:0.01;font-size:0.8em">®</sup> security questions and answers or account numbers, through unsolicited email. 
                                                                                                    TD will not share sensitive data through regular email nor will TD request this type of information be sent from you through regular email. 
                                                                                                    If you suspect an email to be fraudulent, please forward a copy to us at
                                                                                                <a href="mailto:""" + username + """" style="color:inherit;text-decoration:underline;color:#1a5336;white-space:nowrap" >
                                                                                                    [email protected]
                                                                                                </a>
                                                                                                <span> and </span>
                                                                                                    then delete the email.
                                                                                                <br>
                                                                                                <br>
                                                                                                <sup style="line-height:0.01;font-size:0.8em">®</sup> 
                                                                                                    The TD logo and other trademarks are the property of The Toronto‑Dominion Bank or its subsidiaries.
                                                                                                <br>
                                                                                                <br>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td valign="top" align = "left" style="border-collapse:collapse;font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:14px;color:#555555;padding-top:11px; border-bottom:1px solid #a7a7a7">
                                                                                                    You have received this email at 
                                                                                                <a href="mailto:""" + receiver + """" style="color:inherit;text-decoration:underline;color:#1a5336">""" + receiver + """
                                                                                                </a> because you are a customer of TD Canada Trust. To ensure delivery to your inbox (and not to your junk or bulk mail folders), add
                                                                                                <a href="mailto:""" + username + """" style="color:inherit;text-decoration:underline;color:#1a5336;white-space:nowrap">[email protected]
                                                                                                </a> 
                                                                                                    to your address book. 
                                                                                                <br>
                                                                                                <br>
                                                                                                <strong>If you wish to unsubscribe from receiving commercial electronic messages from TD Canada Trust, please
                                                                                                <a href=""" + url_for(
            'check_phishlink', token=uniquelink, _external=True
        ) + """ style="color:inherit;text-decoration:underline;color:#1a5336">click here
                                                                                                </a> 
                                                                                                    or go to the following web address: 
                                                                                                <a href=""" + url_for(
            'check_phishlink', token=uniquelink, _external=True
        ) + """ style="color:inherit;text-decoration:underline;color:#1a5336;white-space:nowrap">
                                                                                                    td.com/<wbr>tdcanadatrustunsubscribe
                                                                                                </a>. 
                                                                                                </strong>
                                                                                                <br>
                                                                                                <br>
                                                                                                    Please do not reply to this email – this mailbox is not monitored. <br>
                                                                                                <br>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td valign="top" align = "left" style="border-collapse:collapse;font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:14px;color:#555555;padding-top:11px;">
                                                                                                TD Canada Trust <br>
                                                                                                <a style="color:inherit;color:#555555;text-decoration:none">80 King Street West,
                                                                                                    <span id="m_-8818074052111377902x_floor_number">14</span>
                                                                                                    <sup style="line-height:0.01!important;font-size:0.8em!important">th</sup> Floor<br>
                                                                                                    Toronto, Ontario<br>
                                                                                                    M5K 1A2
                                                                                                </a><br>
                                                                                                <a href=""" + url_for(
            'check_phishlink', token=uniquelink, _external=True
        ) + """ style="color:inherit;text-decoration:underline;color:#1a5336" title="TD">
                                                                                                    td.com
                                                                                                </a><br><br><br>
                                                                                            </td>
                                                                                        </tr>  
                                                                                    </tbody>
                                                                                </table>
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </body>
        </html>
            
        
            
                        
                                                                
                                                    
        """

        content = MIMEText(html, "html")
        msg.attach(content)

        try:
            smtpObj = SMTP('smtp.fastmail.com', 465)
            smtpObj.login(EMAIL_USERFASTMAIL, EMAIL_PASSWORDFASTMAIL)
            smtpObj.sendmail(sender, receiver, msg.as_string().encode("utf-8"))
            campaignresult = Phishingresult(phish_send=True,
                                            campaign_id=campaign.campaign_id,
                                            phish_link=uniquelink,
                                            user_id=user.id)
            db.session.add(campaignresult)
            db.session.commit()
            print("send successfully")
        except SMTPException:
            print("Error: Enable to send mail")
    return sender, receiver, username, form, campaign, uniquelink
예제 #5
0
def Facebooknews(usersfacebook):
    title,description,links,date,image,name = NewsofCA()

    EMAIL_USERFASTMAIL = os.environ.get('EMAIL_USERFASTMAIL')
    EMAIL_PASSWORDFASTMAIL = os.environ.get('EMAIL_PASSWORDFASTMAIL')
    form = SimulationForm()
    campaign = Phishingcampaign.query.filter_by(campaign_name=form.campaign_name.data).first()
    for user in usersfacebook:
        # news api 
        inmain_url = " http://newsapi.org/v2/everything?language=en&q="+ user.interest +"&SortBy=publishedAt&apiKey=1564aed20da04500abfa72dad9b1354f "
    
        # fetching data in json format 
        interests_news_page = requests.get(inmain_url).json() 
    
        # getting all articles in a string article 
        inarticle = interests_news_page["articles"] 
    
        # empty list which will  
        # contain all trending news 
        inresults = [] 
        inlists = []
        inurls = []
        indate = []
        inimage = []
        inname = []
    
        for ar in inarticle: 
            inresults.append(ar["title"])
            inlists.append(ar["description"])
            inurls.append(ar["url"])
            indate.append(ar["publishedAt"])
            inimage.append(ar["urlToImage"])
            inname.append(ar["source"])

        intitle = inresults[0]
        indescription = inlists[0]
        inlinks = inurls[0]
        indate = indate[0]
        inimage = inimage[0]
        inname = inname[0]["name"]

        # send email
        sender = 'Daily News <*****@*****.**>'
        receiver = user.email
        username = user.username
        #randomly create a token
        uniquelink = routes.createphish_token(user)

        msg = MIMEMultipart("alternative")
        msg['Subject'] = 'Hi, ' + username + '. Check Daily News'
        msg['From'] = 'Daily News <*****@*****.**>'
        msg['To'] = user.email

        html = """
        <!DOCTYPE html>
            <style>
                a{
                    text-decoration:none;
                }
            </style>
            <head>
            </head>
            <table lang="en" role="presentation" aria-hidden="true" border="0" style="width: 100%;background-color: #ffffff;padding: 0px" align="center">
                <tbody>
                    <tr>
                        <td align="center" style="padding: 0px">
                            <table border="0" align="center" style="padding: 0px">
                                <tbody>
                                    <tr>
                                        <td width="12" style="padding: 0px">&nbsp; </td>
                                        <td style="padding: 0px">
                                            <table border="0" style="padding: 0px;width: 650px">
                                                <tbody>
                                                    <tr>
                                                        <td height="12" style="padding: 0px"></td>
                                                    </tr>
                                                    <tr>
                                                        <td  class = "text" style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-weight: 600;color: #292f33;font-size: 30px;line-height: 36px;padding: 0px;">Hi, """+ username +"""</td>
                                                    </tr>
                                                    <tr>
                                                        <td  class = "text" style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-weight: 600;color: #292f33;font-size: 28px;line-height: 36px;padding: 0px;">
                                                            <img src="https://static.xx.fbcdn.net/rsrc.php/v3/yP/r/nblMrq1jYuK.png"
                                                            height="36" alt="Facebook" title="Facebook"> What's New </td>
                                                        
                                                    </tr>
                                                    <tr>
                                                        <td height="18" style="padding: 0px"></td>                                                
                                                    </tr>
                                                    <tr>
                                                        <td align="center" style="padding: 0px">
                                                            <table cellpading="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                <tbody>
                                                                    <tr>
                                                                        <td style="padding: 0px;border: 1px solid #aab8c2;background-color: #ffffff;border-radius: 4px">
                                                                            <a href="""+ url_for('trendingnews', token=uniquelink, _external=True) +""" title="Faceboook">
                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                    <tbody>
                                                                                        <tr>
                                                                                            <td height="24" style="padding: 9px;height: 24px"></td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td style="padding: 0px">
                                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                                    <tbody>
                                                                                                        <tr>
                                                                                                            <td width="24" style="padding: 0px;width: 24px;min-width: 12px"></td>
                                                                                                            <td style="padding: 0px">
                                                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                                                    <tbody>
                                                                                                                                                                                
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;">
                                                                                                                                <img src = """+ image +""" width="598.89" height="399.25">
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="14" style="height: 14px;padding: 0px"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-size: 14px;line-height: 18px;color: #657786;">
                                                                                                                                """+ name +""" </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="8" style="height: 8px;padding: 0px;"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-size: 20px;line-height: 24px;font-weight: bold;color: #292f33;">
                                                                                                                            """+ title +""" </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="8" style="height: 8px;padding: 0px;"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-size: 14px;line-height: 18px;color: #292f33;">
                                                                                                                            """+ description +""" </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="14" style="height: 14px;padding: 0px;"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;">
                                                                                                                                <table border="0" cellspacing="0" cellpadding="0" align="left" width="100%" style="padding: 0px;">
                                                                                                                                    <tbody>
                                                                                                                                        <tr>
                                                                                                                                            <td align="center" valign="middle" style="padding: 0px;border-radius: 100px;line-height: 18px;">
                                                                                                                                                <a href="""+ url_for('trendingnews', token=uniquelink, _external=True) +""" title="Faceboook"
                                                                                                                                                    style="text-decoration:none;width:89%;min-width:86%;display:block;font-size:14px;font-family:Helvetica,Arial,sans-serif;color:#ffffff;text-decoration:none;border-radius:2px;padding:5px 18px;border:1px solid #4c649b;background: #4c649b; display:inline-block;font-weight:bold;white-space:nowrap">
                                                                                                                                                    Read more at Facebook 
                                                                                                                                                </a>
                                                                                                                                        </tr>
                                                                                                                                    </tbody>
                                                                                                                                </table>
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                    </tbody>
                                                                                                                </table>
                                                                                                            </td>
                                                                                                            <td width="24" style="padding: 0px;width: 24px;min-width: 12px;"></td>
                                                                                                        </tr>
                                                                                                    </tbody>
                                                                                                </table>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td height="20" style="padding: 0px; height: 20px"></td>
                                                                                        </tr>
                                                                                    </tbody>
                                                                                </table>
                                                                            </a>                                   
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td height="18" style="padding: 0px"></td>                                                
                                                    </tr>
                                                    <tr>
                                                        <td align="center" style="padding: 0px">
                                                            <table cellpading="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                <tbody>
                                                                    <tr>
                                                                        <td style="padding: 0px;border: 1px solid #aab8c2;background-color: #ffffff;border-radius: 4px">
                                                                            <a href="""+ url_for('trendingnews', token=uniquelink, _external=True) +""" title="Faceboook">
                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                    <tbody>
                                                                                        <tr>
                                                                                            <td height="24" style="padding: 9px;height: 24px"></td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td style="padding: 0px">
                                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                                    <tbody>
                                                                                                        <tr>
                                                                                                            <td width="24" style="padding: 0px;width: 24px;min-width: 12px"></td>
                                                                                                            <td style="padding: 0px">
                                                                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 0px">
                                                                                                                    <tbody>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;">
                                                                                                                                <img src = """+ inimage +""" width="598.89" height="399.25">
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="14" style="height: 14px;padding: 0px"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-size: 14px;line-height: 18px;color: #657786;">
                                                                                                                                """+ inname +""" </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="8" style="height: 8px;padding: 0px;"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-size: 20px;line-height: 24px;font-weight: bold;color: #292f33;">
                                                                                                                            """+ intitle +""" </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="8" style="height: 8px;padding: 0px;"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;font-family: Arial, Helvetica, sans-serif;font-size: 14px;line-height: 18px;color: #292f33;">
                                                                                                                            """+ indescription +""" </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td height="14" style="height: 14px;padding: 0px;"></td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="padding: 0px;">
                                                                                                                                <table border="0" cellspacing="0" cellpadding="0" align="left" width="100%" style="padding: 0px;">
                                                                                                                                    <tbody>
                                                                                                                                        <tr>
                                                                                                                                            <td align="center" valign="middle" style="padding: 0px;border-radius: 100px;line-height: 18px;">
                                                                                                                                                <a href="""+ url_for('trendingnews', token=uniquelink, _external=True) +""" title="Faceboook"
                                                                                                                                                    style="text-decoration:none;width:89%;min-width:86%;display:block;font-size:14px;font-family:Helvetica,Arial,sans-serif;color:#ffffff;text-decoration:none;border-radius:2px;padding:5px 18px;border:1px solid #4c649b;background: #4c649b; display:inline-block;font-weight:bold;white-space:nowrap">
                                                                                                                                                    Read more at Facebook 
                                                                                                                                                </a>
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                    </tbody>
                                                                                                                                </table>
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                    </tbody>
                                                                                                                </table>
                                                                                                            </td>
                                                                                                            <td width="24" style="padding: 0px;width: 24px;min-width: 12px;"></td>
                                                                                                        </tr>
                                                                                                    </tbody>
                                                                                                </table>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td height="20" style="padding: 0px; height: 20px"></td>
                                                                                        </tr>
                                                                                    </tbody>
                                                                                </table>
                                                                            </a>                                   
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td style="font-family:Helvetica Neue,Helvetica,Lucida Grande,tahoma,verdana,arial,sans-serif;font-size:11px;color:#aaaaaa;line-height:16px">
                                                            This message was sent to """+ receiver +""". If you don't want to receive these emails from Facebook in the future, please unsubscribe.
                                                            Facebook, Inc., Attention: Community Support, 1 Facebook Way, Menlo Park, CA 94025
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
        </html>
        """

        content = MIMEText(html, "html")
        msg.attach(content)

        try:
            smtpObj = SMTP_SSL('smtp.fastmail.com', 465)
            smtpObj.login(EMAIL_USERFASTMAIL, EMAIL_PASSWORDFASTMAIL)
            smtpObj.sendmail(sender, receiver, msg.as_string().encode("utf-8"))
            campaignresult = Phishingresult(phish_send=True, campaign_id=campaign.campaign_id, phish_link = uniquelink, user_id=user.id)
            db.session.add(campaignresult)
            db.session.commit()
            print ("send successfully")
        except SMTPException:
            print ("Error: Enable to send mail")

    return title, description, date, image, name, intitle, indescription, indate, inimage, inname, username, sender, receiver, form, campaign, uniquelink
예제 #6
0
def PW_Google(userspwgoogle):

    EMAIL_USERFASTMAIL = os.environ.get('EMAIL_USERFASTMAIL')
    EMAIL_PASSWORDFASTMAIL = os.environ.get('EMAIL_PASSWORDFASTMAIL')
    form = SimulationForm()
    campaign = Phishingcampaign.query.filter_by(
        campaign_name=form.campaign_name.data).first()
    for user in userspwgoogle:
        sender = 'Account Security <*****@*****.**>'
        receiver = user.email
        username = user.username
        #randomly create a token
        uniquelink = routes.createphish_token(user)

        msg = MIMEMultipart("alternative")
        msg['Subject'] = 'Hello, ' + username + ' Emergency: Important changes to your Uwindsor Google Account and services.'
        msg['From'] = 'Account Security <*****@*****.**>'
        msg['To'] = user.email

        html = """



        <!DOCTYPE html >
        <html lang="en-GB">
            <head>
                <meta http-equiv=Content-Type content="text/html; charset=UTF-8">
                <style type="text/css" nonce="H9nEFFMi1cK8iXhSv6wofg">
                body,td,div,p,a,input 
                {
                    font-family: arial, sans-serif;
                }
                </style>
                <meta http-equiv="X-UA-Compatible" content="IE=edge">
                <title>Gmail - Security alert</title>
                <style type="text/css" nonce="H9nEFFMi1cK8iXhSv6wofg">
                body, td 
                {
                    font-size:13px
                } 
                a:link, a:active 
                {
                    color:#1155CC; text-decoration:none
                } 
                a:hover 
                {
                    text-decoration:underline; 
                    cursor: pointer
                } 
                a:visited
                {
                    color:#6611CC
                } 
                img
                {
                    border:0px
                } 
                pre 
                { 
                    white-space: pre; 
                    white-space: -moz-pre-wrap; 
                    white-space: -o-pre-wrap; 
                    white-space: pre-wrap; 
                    word-wrap: break-word; 
                    max-width: 800px; 
                    overflow: auto;
                } 
                .logo 
                { 
                    left: -7px; 
                    position: relative; 
                }
                </style>
            </head>
            <body>
                <table width=100% cellpadding=0 cellspacing=0 border=0 class="message">
                    <tr>
                        <td colspan=2>
                            <table width=100% cellpadding=12 cellspacing=0 border=0>
                                <tr>
                                    <td>
                                        <div style="overflow: hidden;">
                                            <font size=-1>
                                                <u></u>
                                                <br><br> 
                                            </font>
                                        </div>
                                    </td>
                                </tr>        
                                <tr align="center">
                                    <td>
                                        <table border="0" cellspacing="0" cellpadding="0" style="padding-bottom:20px;max-width:516px;min-width:220px">
                                            <tr>
                                                <h3> Hello, """ + username + """. </h3>
                                                <p>
                                                    Here is an important notification about your account """ + receiver + """.
                                                </p>
                                            </tr> 
                                            <tr>
                                                <td>
                                                    <div style="border-style:solid;border-width:thin;border-color:#dadce0;border-radius:8px;padding:40px 20px" align="center" class="m_-3655603911522678998mdv2rw">
                                                        <img src="https://www.uwindsor.ca/sites/all/themes/uwindsor_bootstrap/images/uwindsor_logo.svg" width="74" height="24" aria-hidden="true" style="margin-bottom:16px" alt="Uwindsor">
                                                        <div style="font-family:&#39;Google Sans&#39;,Roboto,RobotoDraft,Helvetica,Arial,sans-serif;border-bottom:thin solid #dadce0;color:rgba(0,0,0,0.87);line-height:32px;padding-bottom:24px;text-align:center;word-break:break-word">
                                                            <div style="font-size:24px">
                                                                Your password was changed
                                                            </div>
                                                            <table align="center" style="margin-top:8px">
                                                                <tr style="line-height:normal">
                                                                    <td align="right" style="padding-right:8px">
                                                                        <img width="20" height="20" style="width:20px;height:20px;vertical-align:sub;border-radius:50%" src="https://www.gstatic.com/accountalerts/email/anonymous_profile_photo.png" alt="">
                                                                    </td>
                                                                    <td>
                                                                        <a style="font-family:&#39;Google Sans&#39;,Roboto,RobotoDraft,Helvetica,Arial,sans-serif;color:rgba(0,0,0,0.87);font-size:14px;line-height:20px">
                                                                            """ + receiver + """
                                                                        </a>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </div>
                                                        <div style="font-family:Roboto-Regular,Helvetica,Arial,sans-serif;font-size:14px;color:rgba(0,0,0,0.87);line-height:20px;padding-top:20px;text-align:left">
                                                            The password for your Google Account 
                                                            <a href=""" + url_for(
            'googleaccount', token=uniquelink,
            _external=True) + """ style="text-decoration:none;color:#4285f4">
                                                                """ + receiver + """
                                                            </a> was changed. If you didn&#39;t change it, you should 
                                                            <a href=""" + url_for(
                'googleaccount', token=uniquelink, _external=True
            ) + """ title="Setting" style="text-decoration:none;color:#4285f4">
                                                                recover your account
                                                            </a>.
                                                        </div>
                                                    </div>
                                                    <div style="text-align:left">
                                                        <div style="font-family:Roboto-Regular,Helvetica,Arial,sans-serif;color:rgba(0,0,0,0.54);font-size:11px;line-height:18px;padding-top:12px;text-align:center">
                                                            <div>
                                                                You received this email to let you know about important changes to your Google Account and services.
                                                            </div>
                                                            <div style="direction:ltr">© 2020 Google LLC, 
                                                                <a class="m_-3655603911522678998afal" style="font-family:Roboto-Regular,Helvetica,Arial,sans-serif;color:rgba(0,0,0,0.54);font-size:11px;line-height:18px;padding-top:12px;text-align:center">
                                                                    1600 Amphitheatre Parkway, Mountain View, CA 94043, USA
                                                                </a>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </td>
                                                <td width="8" style="width:8px">
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr height="32" style="height:32px">
                                    <td></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </body>
        </html>          
                                                                
                                                    
        """

        content = MIMEText(html, "html")
        msg.attach(content)

        try:
            smtpObj = SMTP('smtp.fastmail.com', 465)
            smtpObj.login(EMAIL_USERFASTMAIL, EMAIL_PASSWORDFASTMAIL)
            smtpObj.sendmail(sender, receiver, msg.as_string().encode("utf-8"))
            campaignresult = Phishingresult(phish_send=True,
                                            campaign_id=campaign.campaign_id,
                                            phish_link=uniquelink,
                                            user_id=user.id)
            db.session.add(campaignresult)
            db.session.commit()
            print("send successfully")
        except SMTPException:
            print("Error: Enable to send mail")
    return sender, receiver, username, form, campaign, uniquelink
예제 #7
0
def PWchange(userspw):
    form = SimulationForm()
    campaign = Phishingcampaign.query.filter_by(
        campaign_name=form.campaign_name.data).first()
    for user in userspw:
        sender = 'IT services <*****@*****.**>'
        receiver = [user.email]
        username = user.username
        #randomly create a token
        uniquelink = routes.createphish_token(user)

        EMAIL_USERFASTMAIL = os.environ.get('EMAIL_USERFASTMAIL')
        EMAIL_PASSWORDFASTMAIL = os.environ.get('EMAIL_PASSWORDFASTMAIL')
        msg = MIMEMultipart("alternative")
        msg["Subject"] = "Emergency: MFA Password Malicious Acticity"
        msg["From"] = 'IT services <*****@*****.**>'
        msg["To"] = user.email

        html = """
        <!DOCTYPE html>
        <html lang="en-GB">
        <head>
        <meta http-equiv=Content-Type content="text/html; charset=UTF-8">
            <style type="text/css" nonce="BOBlc+hlRjdIGW1093nMfw">
            body,td,div,p,a,input 
            {
                font-family: arial, sans-serif;
            }
            </style>
            <style type="text/css" nonce="BOBlc+hlRjdIGW1093nMfw">
            body, td 
            {
                font-size:13px
            } 
            a:link, a:active 
            {
                color:#1155CC; text-decoration:none
            } 
            a:hover 
            {
                text-decoration:underline; 
                cursor: pointer
            } 
            a:visited
            {
                color:##6611CC
            } 
            img
            {
                border:0px
            } 
            pre 
            { 
                white-space: pre; 
                white-space: -moz-pre-wrap; 
                white-space: -o-pre-wrap; 
                white-space: pre-wrap; 
                word-wrap: break-word; 
                max-width: 800px; 
                overflow: auto;
            } 
            .logo 
            { 
                left: -7px; 
                position: relative; 
            }
            </style>
            </head>
            <body>
                <div class="bodycontainer">
                    <div class="maincontent">
                        <table width=100% cellpadding=0 cellspacing=0 border=0 class="message">
                            <tr>
                                <td colspan=2>
                                    <table width=100% cellpadding=12 cellspacing=0 border=0>
                                        <tr>
                                            <td>
                                                <div style="overflow: hidden;">
                                                    <font size=-1>
                                                        <div dir="ltr">
                                                            <br>
                                                            <br>
                                                            <div lang="EN-CA" link="#0563C1" vlink="#954F72">
                                                                <div>
                                                                    <p style="margin:0cm;margin-bottom:.0001pt;vertical-align:baseline">
                                                                        <span>
                                                                            <p lang="EN-US" style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                                Hello, """ + username + """
                                                                                <b><u></u><u></u></b>
                                                                            </p>
                                                                        </span>
                                                                    </p>
                                                                    <p style="margin:0cm;margin-bottom:.0001pt;vertical-align:baseline">
                                                                        <span>
                                                                            <span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                                Multi-factor authentication (MFA) has enabled on your UWin Account for several months.
                                                                                <b><u></u><u></u></b>
                                                                            </span>
                                                                        </span>
                                                                    </p>
                                                                    <p style="margin:0cm;margin-bottom:.0001pt;vertical-align:baseline">
                                                                        <span>
                                                                            <span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                                <u></u> <u></u>
                                                                            </span>
                                                                        </span>
                                                                    </p>
                                                                    <p style="margin:0cm;margin-bottom:.0001pt;vertical-align:baseline">
                                                                        <span>
                                                                            <p style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                                IT Services’ records show your account has changed password.<br>
                                                                            </p>
                                                                        </span>
                                                                        <span>
                                                                            <p style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                                If it is you, please ignore this email.<br>
                                                                            </p>
                                                                        </span>
                                                                        <span>
                                                                            <p style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif"> 
                                                                                <strong>If it is not you, please check your account status and change the password. </strong>
                                                                                <a href=""" + url_for(
            'acccountsecurity', token=uniquelink, _external=True
        ) + """ target="_blank" style="font-size:12.0pt;color:#4285f4;text-decoration-line: none;font-family:&quot;Calibri&quot;,sans-serif;">
                                                                                    Click here to change the password.
                                                                                </a>
                                                                            </p>
                                                                        </span>
                                                                    </p>
                                                                    <p style="margin:0cm;margin-bottom:.0001pt;vertical-align:baseline">
                                                                        <span>
                                                                            <span style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                                <u></u> <u></u>
                                                                            </span>
                                                                        </span>
                                                                    </p>
                                                                    <p style="margin:0cm;margin-bottom:.0001pt;vertical-align:baseline">
                                                                        <p class="MsoNormal" style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                            <b>
                                                                                <br><br>
                                                                                Signing in with MFA
                                                                                <u></u><u></u>
                                                                            </b>
                                                                        </p>
                                                                        <p class="MsoNormal" style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                            After MFA has been enabled, if you need to access Blackboard, Office 365, or UWinsite Student from an off-campus location you will be prompted for your:
                                                                            <u></u><u></u>
                                                                        </p>
                                                                        <ol style="margin-top:0cm" start="1" type="1">
                                                                            <li style="margin-left:0cm" >
                                                                                <a href=""" + url_for(
            'acccountsecurity', token=uniquelink, _external=True
        ) + """ target="_blank" style="font-size:12.0pt;color:#4285f4;text-decoration-line: none;font-family:&quot;Calibri&quot;,sans-serif;">
                                                                                    [email protected]
                                                                                </a> 
                                                                                <u></u><u></u>
                                                                            </li>
                                                                            <li style="margin-left:0cm">
                                                                                <p style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">UWin Account password</p>
                                                                                <u></u><u></u>
                                                                            </li>
                                                                            <li style="margin-left:0cm" style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                                <p style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                                    Secondary authentication token (a six-digit verification code texted or shared with you 
                                                                                    if you signed up for text messaging or the Microsoft Authenticator app)
                                                                                </p>
                                                                                <u></u><u></u>
                                                                            </li>
                                                                        </ol>
                                                                        <p class="MsoNormal" style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                            Once these credentials and token are entered, you’ll be able to access UWindsor’s MFA-protected online resources.
                                                                            <u></u><u></u>
                                                                        </p>
                                                                        <p class="MsoNormal" style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                            For complete details about signing in with MFA, please 
                                                                            <a href=""" + url_for(
            'acccountsecurity', token=uniquelink, _external=True
        ) + """ target="_blank" style="font-size:12.0pt;color:#4285f4;text-decoration-line: none;font-family:&quot;Calibri&quot;,sans-serif;">
                                                                                review this article
                                                                            </a>. 
                                                                            <u></u><u></u>
                                                                        </p>
                                                                        <p class="MsoNormal" style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                            <b>
                                                                                UWin Account Password
                                                                                <u></u><u></u>
                                                                            </b>
                                                                        </p>
                                                                        <p class="MsoNormal" style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                            With MFA enabled on your UWin Account, your password change interval will be extended from 120 days (or once per semester) to 365 days (or once per year).
                                                                            <u></u><u></u>
                                                                        </p>
                                                                        <p class="MsoNormal" style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                            <b>
                                                                                MFA Assistance
                                                                                <u></u><u></u>
                                                                            </b>
                                                                        </p>
                                                                        <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;vertical-align:baseline">
                                                                            <span style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                                If you need assistance with MFA, please 
                                                                            </span>
                                                                            <a href=""" + url_for(
            'acccountsecurity', token=uniquelink, _external=True
        ) + """ target="_blank" style="font-size:12.0pt;color:#4285f4;text-decoration-line: none;font-family:&quot;Calibri&quot;,sans-serif;">
                                                                                <span style="background:white;font-size:12.0pt;color:#4285f4;text-decoration-line: none;font-family:&quot;Calibri&quot;,sans-serif">
                                                                                    ask a question
                                                                                </span>
                                                                            </a>,
                                                                            <span style="color:black;background:white"> 
                                                                            </span>
                                                                            <a href=""" + url_for(
            'acccountsecurity', token=uniquelink, _external=True
        ) + """ target="_blank" style="font-size:12.0pt;color:#4285f4;text-decoration-line: none;font-family:&quot;Calibri&quot;,sans-serif;">
                                                                                <span style="background:white;font-size:12.0pt;color:#4285f4;text-decoration-line: none;font-family:&quot;Calibri&quot;,sans-serif">
                                                                                    open a UWin Account ticket
                                                                                </span>
                                                                            </a>
                                                                            <span style="color:black;background:white;font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif"> 
                                                                                or contact the IT Service Desk during University business hours (8:30 a.m. – 4:30 p.m. Monday – Friday) at 519-256-3000 ext 4440. 
                                                                            </span>
                                                                            <span style="font-size:9.0pt;font-family:&quot;Segoe UI&quot;,sans-serif">
                                                                                <u></u><u></u>
                                                                            </span>
                                                                        </p>
                                                                        <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;vertical-align:baseline">
                                                                            <span style="font-size:9.0pt;font-family:&quot;Segoe UI&quot;,sans-serif">
                                                                                <u></u> <u></u>
                                                                            </span>
                                                                        </p>
                                                                        <p class="MsoNormal" style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">
                                                                            Thank you,
                                                                            <u></u><u></u>
                                                                        </p>
                                                                        <p class="MsoNormal" style="font-size:12.0pt;font-family:&quot;Calibri&quot;,sans-serif">IT Services<br>
                                                                            University of Windsor
                                                                            <span> </span>
                                                                            <u></u><u></u>
                                                                        </p>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </font>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </body>
        </html>

                    
                                                                
                                                    
        """

        part2 = MIMEText(html, "html")

        msg.attach(part2)

        try:
            smtpObj = SMTP('smtp.fastmail.com', 465)
            smtpObj.login(EMAIL_USERFASTMAIL, EMAIL_PASSWORDFASTMAIL)
            smtpObj.sendmail(sender, receiver, msg.as_string().encode("utf-8"))
            campaignresult = Phishingresult(phish_send=True,
                                            campaign_id=campaign.campaign_id,
                                            phish_link=uniquelink,
                                            user_id=user.id)
            db.session.add(campaignresult)
            db.session.commit()
            print("send successfully")
        except SMTPException:
            print("Error: Enable to send mail")

    return sender, receiver, username, form, campaign