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 or any(ml.nlu_classifier(body.current_thread.text).entities,
29 .name == "org" and strings.icontains(.text, 'microsoft teams meeting')
30 )
31 // either the subject or sender.display name containt Microsoft Teams and Meeting
32 or (
33 any([subject.base, sender.display_name],
34 strings.icontains(., 'Microsoft Teams')
35 and strings.icontains(., 'meeting')
36 )
37 )
38 or length(filter(ml.nlu_classifier(body.current_thread.text).entities,
39 .name == "org"
40 and strings.icontains(.text, "microsoft teams")
41 )
42 ) >= 2
43 )
44 and (
45 (
46 // not a reply
47 length(headers.references) == 0
48 and headers.in_reply_to is null
49 // few links
50 and length(distinct(body.links, .href_url.url)) < 10
51 // short body
52 and (
53 length(body.current_thread.text) < 600
54 // account for NLU disclaimer in length
55 or any(map(filter(ml.nlu_classifier(body.current_thread.text).entities,
56 .name == "disclaimer"
57 ),
58 .text
59 ),
60 (length(body.current_thread.text) - length(.)) < 600
61 )
62 // NLU only tags the first english disclaimer, so pick up repeat disclaimers or non-english disclaimers as well
63 or any(regex.iextract(body.current_thread.text,
64 '^(?P<disclaimer>.{100,}?)(?:confidentiality notice|nota di riservatezza)'
65 ),
66 length(.named_groups["disclaimer"]) < 600
67 )
68 )
69 ) // or sender domain is new
70 or network.whois(sender.email.domain).days_old < 365
71 )
72 // no unsubscribe links
73 // common in newsletters which link to a webinar style event
74 and not any(body.links, strings.icontains(.display_text, "unsub"))
75
76 // one of the links contains is a CTA that doesn't link to MS
77 and any(body.current_thread.links,
78 (
79 .display_text =~ "join the meeting"
80 or strings.icontains(.display_text,
81 "join the meeting",
82 "play recording",
83 "open in teams"
84 )
85 // is a mismatched domain via .display_url
86 or (
87 .display_url.domain.root_domain in (
88 "microsoft.com",
89 "microsoft.us",
90 "microsoft.cn",
91 "live.com"
92 )
93 and .mismatched
94 )
95 )
96 and .href_url.domain.root_domain not in (
97 "microsoft.com",
98 "microsoft.us",
99 "microsoft.cn",
100 "live.com"
101 )
102 and not (
103 .href_url.domain.root_domain == "mimecastprotect.com"
104 and (
105 strings.parse_domain(.href_url.query_params_decoded["domain"][0]).root_domain in (
106 "microsoft.com",
107 "microsoft.us",
108 "microsoft.cn",
109 "live.com"
110 )
111 or strings.parse_domain(.href_url.query_params_decoded["domain"][0]).root_domain in $bulk_mailer_url_root_domains
112 )
113 )
114 // rewriters often abstract the link
115 and .href_url.domain.root_domain not in $bulk_mailer_url_root_domains
116 )
117 // missing the dial by phone element
118 and not strings.icontains(body.current_thread.text, 'Dial in by phone')
119
120 // any of these suspicious elements from the body
121 and (
122 // malicious samples leveraged recipient domain branding here
123 not strings.icontains(body.current_thread.text, 'Microsoft Teams Need help?')
124 // malicious samples contained unique html elements not present in legit ones
125 or strings.icontains(body.html.raw, '<div class="meeting-title">')
126 or strings.icontains(body.html.raw, '<div class="meeting-time">')
127 or strings.icontains(body.html.raw, '<div class="meeting-location">')
128 or strings.icontains(body.html.raw, '<span class="conflict-badge">')
129 or strings.icontains(body.html.raw, 'class="join-button"')
130 )
131
132 // negate highly trusted sender domains unless they fail DMARC authentication
133 and not (
134 sender.email.domain.root_domain in $high_trust_sender_root_domains
135 and coalesce(headers.auth_summary.dmarc.pass, false)
136 )
137attack_types:
138 - "Credential Phishing"
139tactics_and_techniques:
140 - "Impersonation: Brand"
141 - "Social engineering"
142detection_methods:
143 - "Content analysis"
144 - "Header analysis"
145 - "HTML analysis"
146 - "URL analysis"
147id: "46410ad8-3465-505f-a78e-f77704910a91"