Brand impersonation: Microsoft Teams invitation

Detects messages impersonating a Microsoft Teams invites by matching known invite text patterns while containing join links that do not resolve to Microsoft domains. Additional verification includes checking for absent phone dial-in options and missing standard Teams help text or HTML meeting components.

Sublime rule (View on GitHub)

  1name: "Brand impersonation: Microsoft Teams invitation"
  2description: "Detects messages impersonating a Microsoft Teams invites by matching known invite text patterns while containing join links that do not resolve to Microsoft domains. Additional verification includes checking for absent phone dial-in options and missing standard Teams help text or HTML meeting components."
  3type: "rule"
  4severity: "high"
  5source: |
  6  type.inbound
  7  and (
  8    (
  9      strings.icontains(body.current_thread.text, 'Microsoft Teams')
 10      and strings.icontains(body.current_thread.text,
 11                            'join the meeting',
 12                            'confirm your attendance',
 13                            'confirm attendance'
 14      )
 15      and strings.contains(body.current_thread.text, 'Meeting ID:')
 16      and strings.contains(body.current_thread.text, 'Passcode:')
 17    )
 18    or (
 19      strings.icontains(body.current_thread.text, "teams")
 20      // strings that give us confidence it's teams
 21      and 2 of (
 22        strings.icontains(body.current_thread.text, "internal"),
 23        strings.icontains(body.current_thread.text, "message"),
 24        strings.icontains(body.current_thread.text, "meeting"),
 25        strings.icontains(body.current_thread.text, "Download Teams")
 26      )
 27    )
 28    // either the subject or sender.display name containt Microsoft Teams and Meeting
 29    or (
 30      any([subject.base, sender.display_name],
 31          strings.icontains(., 'Microsoft Teams')
 32          and strings.icontains(., 'meeting')
 33      )
 34    )
 35  )
 36  // not a reply
 37  and length(headers.references) == 0
 38  and headers.in_reply_to is null
 39  // few links
 40  and length(distinct(body.links, .href_url.url)) < 10
 41  // short body
 42  and (
 43    length(body.current_thread.text) < 600
 44    // account for NLU disclaimer in length
 45    or any(map(filter(ml.nlu_classifier(body.current_thread.text).entities,
 46                      .name == "disclaimer"
 47               ),
 48               .text
 49           ),
 50           (length(body.current_thread.text) - length(.)) < 600
 51    )
 52    // NLU only tags the first english disclaimer, so pick up repeat disclaimers or non-english disclaimers as well 
 53    or any(regex.iextract(body.current_thread.text,
 54                          '^(?P<disclaimer>.{100,}?)(?:confidentiality notice|nota di riservatezza)'
 55           ),
 56           length(.named_groups["disclaimer"]) < 600
 57    )
 58  )
 59  // no unsubscribe links
 60  // common in newsletters which link to a webinar style event
 61  and not any(body.links, strings.icontains(.display_text, "unsub"))
 62  
 63  // one of the links contains is a CTA that doesn't link to MS
 64  and any(body.current_thread.links,
 65          (
 66            .display_text =~ "join the meeting"
 67            or strings.icontains(.display_text, "join the meeting")
 68            or strings.icontains(.display_text, "play recording")
 69            // is a mismatched domain via .display_url
 70            or (
 71              .display_url.domain.root_domain in (
 72                "microsoft.com",
 73                "microsoft.us",
 74                "microsoft.cn",
 75                "live.com"
 76              )
 77              and .mismatched
 78            )
 79          )
 80          and .href_url.domain.root_domain not in (
 81            "microsoft.com",
 82            "microsoft.us",
 83            "microsoft.cn",
 84            "live.com"
 85          )
 86          and not (
 87            .href_url.domain.root_domain == "mimecastprotect.com"
 88            and (
 89              strings.parse_domain(.href_url.query_params_decoded["domain"][0]).root_domain in (
 90                "microsoft.com",
 91                "microsoft.us",
 92                "microsoft.cn",
 93                "live.com"
 94              )
 95              or strings.parse_domain(.href_url.query_params_decoded["domain"][0]).root_domain in $bulk_mailer_url_root_domains
 96            )
 97          )
 98          // rewriters often abstract the link
 99          and .href_url.domain.root_domain not in $bulk_mailer_url_root_domains
100  )
101  // missing the dial by phone element
102  and not strings.icontains(body.current_thread.text, 'Dial in by phone')
103  
104  // any of these suspicious elements from the body
105  and (
106    // malicious samples leveraged recipient domain branding here
107    not strings.icontains(body.current_thread.text, 'Microsoft Teams Need help?')
108    // malicious samples contained unique html elements not present in legit ones
109    or strings.icontains(body.html.raw, '<div class="meeting-title">')
110    or strings.icontains(body.html.raw, '<div class="meeting-time">')
111    or strings.icontains(body.html.raw, '<div class="meeting-location">')
112    or strings.icontains(body.html.raw, '<span class="conflict-badge">')
113    or strings.icontains(body.html.raw, 'class="join-button"')
114  )
115  
116  // negate highly trusted sender domains unless they fail DMARC authentication
117  and not (
118    sender.email.domain.root_domain in $high_trust_sender_root_domains
119    and coalesce(headers.auth_summary.dmarc.pass, false)
120  )  
121attack_types:
122  - "Credential Phishing"
123tactics_and_techniques:
124  - "Impersonation: Brand"
125  - "Social engineering"
126detection_methods:
127  - "Content analysis"
128  - "Header analysis"
129  - "HTML analysis"
130  - "URL analysis"
131id: "46410ad8-3465-505f-a78e-f77704910a91"
to-top