Fake voicemail notification (untrusted sender)

This rule detects a common credential phishing vector enticing the user to engage with links under the premise that they have a voicemail to retrieve. The rule looks for voicemail verbiage in the display name, body, subject or a combination of those elements with emojis or a medium to high credential theft NLU Intent from first-time + unsolicited sender.

Sublime rule (View on GitHub)

  1name: "Fake voicemail notification (untrusted sender)"
  2description: |
  3  This rule detects a common credential phishing vector enticing the user to engage with links under the premise that they have a voicemail to retrieve.
  4  The rule looks for voicemail verbiage in the display name, body, subject or a combination of those elements with emojis or a medium to high credential theft NLU Intent from first-time + unsolicited sender.  
  5type: "rule"
  6severity: "medium"
  7source: |
  8  type.inbound
  9  // contains links or attachments
 10  and (
 11    (
 12      0 < length(filter(body.links, .href_url.scheme != "mailto")) <= 25
 13      or 0 < length(distinct(attachments, .md5)) <= 3
 14    )
 15    and 0 <= length(distinct(attachments, .md5)) <= 8
 16  )
 17  
 18  // the subject or display_name need some keywords which are voicemail related
 19  and (
 20    any([subject.subject, sender.display_name],
 21        regex.icontains(.,
 22                        // split phrases that occur within 3 words between or only punctuation between them
 23                        '(?:v[nm](\b|[[:punct:]])?|\bv[o0][il1]ce(?:mail|message)?|audi[o0]|incoming|missed(?:\sa\s)?|left( a)?|wireless)(?:\w+(\s\w+)?|[[:punct:]]+|\s+){0,3}(?:mail|message|msg|recording|received|notif|support|ca[li1][li1]\d*\b|ca[il1][il1](?:er)?|log|transcript(?:ion)?)\b',
 24                        // regex specific to v-mail, v_msg, v,mail, etc
 25                        // list of "secondary" words synced with regex above this one
 26                        'v[[:punct:]](?:mail|message|msg|recording|received|notif|support|ca[li1][li1]\d*\b|ca[il1][il1](?:er)?|log|transcript(?:ion)?\b)',
 27                        // split phrases that start with "caller" that occur within 3 words between or only punctation
 28                        'ca[li1][li1](?:er)?(?:\w+(\s\w+)?|[[:punct:]]+|\s+){0,3}(?:v[nm](\b|[[:punct:]])?|\bv[o0][il1]ce(?:mail|message)?|audi[o0]|missed(?:\sa\s)?|left( a)?)',
 29                        // strong phrases
 30                        '(?:open mp3|audi[o0] note|\.wav|left a vm|[^\s]+voip[^\s]*|unanswered.*ca[li1][li1]|incoming.vm|left msg|wireless ca[li1][li1]er|VM Service|v[o0][il1]ce message|missed.ca[li1][li1](?:e[rd])?|\bca[li1][li1].(?:support|service)(?: for| log)?|missed.{0,10} VM|new v[o0][il1]cemail from|new.v.m.from.\+?\d+|new v[o0][il1]cemail?(?:\w+(\s\w+)?|[[:punct:]]+|\s+){0,3}transcript(s|ion)?|message received|new (?:message|call|voicemail).{0,15}(?:info|notification|alert)|incoming transmission|voice note)',
 31                        // starts in the format of `(4)` and contains some voicemail keywords
 32                        '^\(\d\)\s(?:\w+(\s\w+)?|[[:punct:]]+|\s+){0,3}(?:message|voip|v[o0][il1]ce|unread|call)',
 33                        'ca[li1][li1](?:er)?(?:\w+(\s\w+)?|[[:punct:]]+|\s+){0,3}(?:playback|transcript)',
 34  
 35                        // obfuscated phone number with at least one digit in the area code and at least one obfuscated number in the last group
 36                        // 555-555-555X, 555-555-XXXX, 555-5XX-XXXX
 37                        '\b1?\(?(\d{3}|\d{2}[\*X]|\d[\*X]{2})\)?[^a-z0-9]{0,2}(\d{2,3}|\d{2}[\*X]|\d[\*X]{2}|[\*X]{2,3})[^a-z0-9]{0,4}(\d{3}[\*X]|\d{2}[\*X]{2}|\d[\*X]{3}|[\*X]{3,4})[^0-9]',
 38                        // obfuscated phone number with at least one digit in the prefix
 39                        // XXX-555-5555, XXX-5XX-XXXX
 40                        '\b1?\(?(\d{2}[\*X]|\d[\*X]{2}|[\*X]{2,3})\)?[^a-z0-9]{0,2}(\d{2,3}|\d{2}[\*X]|\d[\*X]{2})[^a-z0-9]{0,4}(\d{4}|\d{3}[\*X]|\d{2}[\*X]{2}|\d[\*X]{3}|[\*X]{3,4})\b',
 41                        // obfuscated voicemail/voicemessage keywords
 42                        'v[o0][il1]ce[\s\-_]?m(?:ail|sg|essage)?[\*X\.\-_]{2,}',
 43                        'v[o0][il1]cem[\*X\.\-_]{2,}',
 44                        // "X new voice..." patterns
 45                        '\d+\s+new.*v[o0][il1]ce(?:mail|message|m[\*]+)?',
 46                        // sent-message patterns
 47                        '(?:sent|new|incoming)[\s\-]+message.*(v[o0][il1]ce|<.*@.*>)',
 48                        // Caller ID UUID present in the subject
 49                        'id\s#[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
 50        )
 51    )
 52    // body.current_thread.text inspection should be very specific to avoid FP
 53    or regex.icontains(strings.replace_confusables(body.current_thread.text),
 54                       // body.current_thread.text,
 55                       'sent (?:from|by) (?:your )?v[o0][il1]ce (?:ma[il1][li1] )?system',
 56                       '(?:(?:new|this) |^)(?:v[o0][il1]ce(?:ma[il1][li1])?|aud[il1][o0]) (?:message|notification|record)',
 57                       'v[o0][il1]cema[il1][li1] (is )?attached',
 58                       'an? (?:new )?encrypted v[o0][il1]cemail',
 59                       'a (?:new )?pending message',
 60                       'Your? have (?: an?)?incoming v[o0][il1]ceRec',
 61                       "you(?:\'ve| have) a (?:new )?m[il1]ssed ca[li1][li1]",
 62                       'New V[o0][il1]cema[il1][li1] Received',
 63                       'New m[il1]ssed ca[li1][li1] record',
 64                       '\bv[o0][il1]cema[il1][li1] transcript\b',
 65                       'Listen to V[o0][il1]ceMa[il1][li1]',
 66                       'New v[o0][il1]cema[il1][li1] from',
 67                       'v[o0][il1]ce note'
 68    )
 69    // pull out two regexes that could benefit from negations
 70    or (
 71      regex.icontains(body.current_thread.text,
 72                      // body.current_thread.text,
 73                      '(?:you|we) (?:have |received )+(?:\w+(\s\w+)?|[[:punct:]]+|\s+){0,3}(?:\b|\s+)v[o0][il1]ce\s?(?:ma[il1][li1]|aud[il1][o0]|message|notification)',
 74                      'left you a (?:\w+(\s\w+)?|[[:punct:]]+|\s+){0,3}(?:v[o0][il1]ce(?:ma[il1][li1])?|aud[il1][o0])(?: message|notification)?',
 75      )
 76      and not regex.icontains(body.current_thread.text,
 77                              '(?:I(?:\sjust)?|just(?: called you at (?:\d+[[:punct:]])+) and)? left you a (?:\w+(\s\w+)?|[[:punct:]]+|\s+){0,3}(?:v[o0][il1]ce(?:mail)?|audio)(?: message)?'
 78      )
 79      and not regex.icontains(body.current_thread.text,
 80                              'you (?:have |received )my voice\s?(?:mail|audio|message)'
 81      )
 82    )
 83    // Reuse the body.current_thread.text logic against the OCR output of the message screenshot
 84    or (
 85      length(attachments) > 0
 86      and (
 87        all(attachments,
 88            .file_type in $file_types_images
 89            and beta.parse_exif(.).image_height != 1
 90        )
 91        // there is a mix of fake audio attachments and images
 92        or (
 93          length(filter(attachments,
 94                        strings.starts_with(.content_type, "audio")
 95                        // confirm the content type with .file_type
 96                        // we have seen attachments claim to be audio/* files, only to be exploded as something else
 97                        and not .file_type in ("wav", "mp3")
 98                 )
 99          ) 
100          // the total # of fake audio attachments + the total # of image attachments = the total # of attachments
101          // meaning, all attachments that are NOT fake audio attachments MUST be images
102          + length(filter(attachments,
103                          .file_type in $file_types_images
104                          and beta.parse_exif(.).image_height != 1
105                   )
106          ) == length(attachments)
107        )
108      )
109      and any((filter(file.explode(file.message_screenshot()), .depth == 0)),
110              regex.icontains(.scan.ocr.raw,
111                              // body.current_thread.text,
112                              'sent (?:from|by) (?:your )?v[o0][il1]ce (?:ma[il1][li1] )?system',
113                              '(?:(?:new|this) |^)(?:v[o0][il1]ce(?:ma[il1][li1])?|aud[il1][o0]) (?:message|notification|record)',
114                              'v[o0][il1]cema[il1][li1] (is )?attached',
115                              'an? (?:new )?encrypted v[o0][il1]cemail',
116                              'a (?:new )?pending message',
117                              'Your? have (?: an?)?incoming v[o0][il1]ceRec',
118                              "you(?:\'ve| have) a (?:new )?m[il1]ssed ca[li1][li1]",
119                              'New V[o0][il1]cema[il1][li1] Received',
120                              'New m[il1]ssed ca[li1][li1] record',
121                              '\bv[o0][il1]cema[il1][li1] transcript\b',
122                              'Listen to V[o0][il1]ceMa[il1][li1]',
123                              'New v[o0][il1]cema[il1][li1] from',
124                              'v[o0][il1]ce note'
125              )
126              or (
127                regex.icontains(.scan.ocr.raw,
128                                // body.current_thread.text,
129                                '(?:you|we) (?:have |received )+(?:\w+(\s\w+)?|[[:punct:]]+|\s+){0,3}(?:\b|\s+)v[o0][il1]ce\s?(?:ma[il1][li1]|aud[il1][o0]|message|notification)',
130                                'left you a (?:\w+(\s\w+)?|[[:punct:]]+|\s+){0,3}(?:v[o0][il1]ce(?:mail)?|audi[o0])(?: message)?',
131                )
132                and not regex.icontains(body.current_thread.text,
133                                        '(?:I(?:\sjust)?|just) left you a (?:\w+(\s\w+)?|[[:punct:]]+|\s+){0,3}(?:voice(?:mail)?|audio)(?: message)?'
134                )
135                and not regex.icontains(body.current_thread.text,
136                                        'you (?:have |received )my voice\s?(?:mail|audio|message)'
137                )
138              )
139      )
140    )
141    or strings.icontains(body.html.raw, '<title>Voicemail Notification</title>')
142    or strings.icontains(body.html.raw, '<!-- Voicemail phone logo')
143  )
144  and 2 of (
145    (
146      // the sender is a freemail
147      sender.email.domain.root_domain in $free_email_providers
148    ),
149    (
150      any(ml.nlu_classifier(body.current_thread.text).intents,
151          .name in ("cred_theft") and .confidence in ("medium", "high")
152      )
153      or 
154      // use the OCR from the message screenshot
155      any(filter(file.explode(file.message_screenshot()), .depth == 0),
156          any(ml.nlu_classifier(.scan.ocr.raw).intents,
157              .name in ("cred_theft") and .confidence in ("medium", "high")
158          )
159      )
160    ),
161    (
162      any(attachments,
163          .content_type in ("html", "text", "text/html")
164          and any(ml.logo_detect(file.html_screenshot(.)).brands,
165                  .name in ("Microsoft") and .confidence in ("medium", "high")
166          )
167      )
168    ),
169    (
170      regex.icontains(sender.display_name,
171                      '(v[o0][il1]ce|audi[o0]|call|missed|caii)(\s?|-)(mail|message|recording|call|caii)|(transcription|Caller.?ID)'
172      )
173    ),
174    // attachment names are often HTML and voice mail related
175    (
176      any(attachments,
177          // this logic is reused below for eml attachments
178          // ensure updates occur both places
179          (
180            .content_type in ("html", "text", "text/html")
181            or .file_type in ("html", "unknown", "svg")
182            or .file_type == "pdf"
183          )
184          and (
185            regex.icontains(.file_name,
186                            '(?:v[o0][il1]ce|aud[i1l][o0]|call|missed|caii|mail|message|recording|call|caii|transcr[il1]ption|v[nm]|audi[o0]|play|listen|unheard|msg)',
187                            // contains a time
188                            // 01min , 60secs
189                            '0?[1-9]\s*min(?:(?:ute)?s)?',
190                            '\d{1,2}\s*s(?:ec(?:ond)?s)?',
191                            // (00:50s)
192                            // 3:26 seconds
193                            '[\(\[]?(?:\d{1,2}[\:\s-])\d{1,2}[\)\]]?\s*(?:s(?:(?:ecs?)onds)?)[\)\]]?',
194                            // 03min25secs
195                            '0?[1-9]\s*min(?:(?:ute)?s)?\d{1,2}\s*s(?:ec(?:ond)?s)?',
196                            // [0:39]
197                            // (0:39)
198                            '[\(\[](?:\d{1,2}[\:\s-])\d{1,2}[\)\]]\s',
199                            // contains an emoji
200                            '[\x{1F300}-\x{1F5FF}\x{1F600}-\x{1F64F}\x{1F680}-\x{1F6FF}\x{1F700}-\x{1F77F}\x{1F780}-\x{1F7FF}\x{1F900}-\x{1F9FF}\x{2600}-\x{26FF}\x{2700}-\x{27BF}\x{2300}-\x{23FF}]'
201            )
202            // somtimes there is no name, it's just the extension which is also strange
203            or .file_name in~ (".htm", ".html")
204            // or sometimes it has no name....
205            or .file_name is null
206          )
207      )
208    ),
209    // attachment contains javascript
210    (
211      any(attachments,
212          (
213            .content_type in ("html", "text", "text/html")
214            or .file_type in ("html", "unknown", "svg")
215          )
216          and (
217            (
218              .size < 1500
219              and any(file.explode(.), length(.scan.html.scripts) > 0)
220            )
221            // bypass the size requirement under these conditions
222            or (
223              // sync with other rules, see related_detections
224              strings.ilike(file.parse_text(.,
225                                            encodings=[
226                                              "ascii",
227                                              "utf8",
228                                              "utf16-le"
229                                            ]
230                            ).text,
231                            "*onload*",
232                            "*window.location.href*",
233                            "*onerror*",
234                            "*CDATA*",
235                            "*<script*",
236                            "*</script*",
237                            "*atob*",
238                            "*location.assign*",
239                            "*decodeURIComponent*"
240              )
241            )
242          )
243      )
244    ),
245    (
246      any(attachments,
247          (
248            .content_type in ("html", "text", "text/html")
249            or .file_type in ("html", "unknown", "svg")
250          )
251          and any(recipients.to,
252                  // the html attachment contains a receipient email address
253                  strings.contains(file.parse_html(..).raw, .email.email)
254                  // the sld of the domain is in the attachment name
255                  or strings.contains(..file_name, .email.domain.sld)
256          )
257      )
258    ),
259    // eml attachments
260    (
261      any(filter(attachments,
262                 .content_type == "message/rfc822" or .file_extension in ('eml')
263          ),
264          // which contain attachments
265          // this is the same logic as above
266          any(file.parse_eml(.).attachments,
267              (
268                .content_type in ("html", "text", "text/html")
269                or .file_type in ("html", "unknown", "svg")
270                or .file_type == "pdf"
271              )
272              and (
273                regex.icontains(.file_name,
274                                '(?:v[o0][il1]ce|aud[il1][o0]|call|missed|caii|mail|message|recording|call|caii|transcr[il1]ption|v[nm]|audi[o0]|play|listen|unheard|msg)',
275                                // contains a time
276                                // 01min , 60secs
277                                '0?[1-9]\s*min(?:(?:ute)?s)?',
278                                '\d{1,2}\s*s(?:ec(?:ond)?s)?',
279                                // (00:50s)
280                                // 3:26 seconds
281                                '[\(\[]?(?:\d{1,2}[\:\s-])\d{1,2}[\)\]]?\s*(?:s(?:(?:ecs?)onds)?)[\)\]]?',
282                                // 03min25secs
283                                '0?[1-9]\s*min(?:(?:ute)?s)?\d{1,2}\s*s(?:ec(?:ond)?s)?',
284                                // [0:39]
285                                // (0:39)
286                                '[\(\[](?:\d{1,2}[\:\s-])\d{1,2}[\)\]]\s',
287                                // contains an emoji
288                                '[\x{1F300}-\x{1F5FF}\x{1F600}-\x{1F64F}\x{1F680}-\x{1F6FF}\x{1F700}-\x{1F77F}\x{1F780}-\x{1F7FF}\x{1F900}-\x{1F9FF}\x{2600}-\x{26FF}\x{2700}-\x{27BF}\x{2300}-\x{23FF}]'
289                )
290                // somtimes there is no name, it's just the extension which is also strange
291                or .file_name in~ (".htm", ".html")
292                // or sometimes it has no name....
293                or .file_name is null
294              )
295          )
296      )
297    ),
298    // attached eml sender/recipeient/subject are all the same as the outer
299    // and have an attachment or body links
300    (
301      any(filter(attachments,
302                 .content_type == "message/rfc822" or .file_extension in ('eml')
303          ),
304          // which contain attachments
305          // this is the same logic as above
306          file.parse_eml(.).subject.subject == subject.subject
307          and file.parse_eml(.).sender.email.email == sender.email.email
308          and (
309            length(file.parse_eml(.).recipients.to) == length(recipients.to)
310            and all(recipients.to,
311                    .email.email in map(file.parse_eml(..).recipients.to,
312                                        .email.email
313                    )
314            )
315          )
316          and (
317            // there are attachments
318            length(file.parse_eml(.).attachments) > 0
319            // or body links
320            or length(filter(file.parse_eml(.).body.links,
321                             .href_url.domain.domain not in $org_domains
322                             and .href_url.domain.root_domain not in $org_domains
323                      )
324            ) > 0
325          )
326      )
327    ),
328    // the body links contain the recipients email
329    (
330      length(filter(recipients.to, .email.email != "" or .email.domain.valid)) > 0
331      and any(body.links,
332              any(recipients.to,
333                  strings.icontains(..href_url.url, .email.email)
334                  or strings.icontains(..href_url.url, .email.local_part)
335              )
336      )
337    ),
338    (
339      length(body.current_thread.text) < 700
340      and regex.icontains(body.current_thread.text,
341                          'Méssãge|Méssage|Recéived|Addréss'
342      )
343    ),
344    // the body is nothing but a single URL
345    (
346      regex.match(body.current_thread.text, '\s*<?https?://\S+\s*')
347      and length(distinct(filter(body.current_thread.links,
348                                 .href_url.scheme != "mailto"
349                          ),
350                          .href_url.url
351                 )
352      ) == 1
353      and not any(body.current_thread.links,
354                  .href_url.scheme != "mailto"
355                  and .href_url.domain.root_domain in $high_trust_sender_root_domains
356      )
357    ),
358    (
359      // sender domain matches no body domains
360      // only inspect "links" that have a display_text and display_url is null to remove "plain text" email address from being caught
361      length(filter(body.links,
362                    .display_text is not null
363                    and .display_url.url is null
364                    and .href_url.domain.valid
365             )
366      ) > 0
367      and all(filter(body.links,
368                     .display_text is not null
369                     and .display_url.url is null
370                     and .href_url.domain.valid
371              ),
372              .href_url.domain.root_domain != sender.email.domain.root_domain
373              and .href_url.domain.root_domain not in $org_domains
374              and .href_url.domain.root_domain not in ("aka.ms")
375              and .href_url.domain.root_domain not in (
376                "unitelvoice.com",
377                "googleapis.com",
378                "dialmycalls.com",
379                "ringcentral.biz",
380                "google.com"
381              )
382      )
383    ),
384    // the body links contain vm related phrases
385    (
386      any(body.links,
387          regex.contains(.display_text, '[^a-z]*[A-Z][^a-z]*')
388          and regex.icontains(.display_text,
389                              '(?:v[nm]|v[o0][il1]ce|audi[o0]|ca[li][li]|missed|preview)(\s?|-)(mail|message|recording|call|caii)|transcription|open mp3|audi[o0] note|listen|playback|\(?(?:\*\*\*|[0-9]{3})?.(?:\*\*\*|[0-9]{3})[^a-z]{0,2}(?:\*{4}|\d+\*+)|play|voice note'
390          )
391          // negate FP terms in link display texts
392          and not strings.icontains(.display_text, 'voice call center')
393      )
394    ),
395    (
396      any(body.links,
397          .href_url.path == "/ctt"
398          and regex.icontains(.display_text,
399                              '(v[nm]|v[o0][il1]ce|audi[o0]|call|missed|caii)(\s?|-)(mail|message|recording|call|caii)|transcription|open mp3|audi[o0] note|listen|playback|\(?(?:\*\*\*|[0-9]{3})?.(?:\*\*\*|[0-9]{3})[^a-z]{0,2}(?:\*{4}|\d+\*+)|play|voice note'
400          )
401          // negate FP terms in link display texts
402          and not strings.icontains(.display_text, 'voice call center')
403      )
404    ),
405    // new domains
406    (
407      any(body.links,
408          network.whois(.href_url.domain).days_old < 10
409          and not strings.icontains(.href_url.path, "unsubscribe")
410      )
411    ),
412    any(body.links,
413        any(.href_url.rewrite.encoders, strings.contains(., "open_redirect"))
414    ),
415    // sld use in sender/subject selements
416    (
417      any(recipients.to,
418          // recipient's SLD is in the sender's display name
419          strings.icontains(sender.display_name, .email.domain.sld)
420          // recipient's SLD is in the sender's display name
421          or strings.icontains(subject.subject, .email.domain.sld)
422          // recipient's SLD is in the senders local_part
423          or strings.icontains(sender.email.local_part, .email.domain.sld)
424      )
425    ),
426    // often times the subject or sender display name will contain time references
427    (
428      any([sender.display_name, subject.subject, body.current_thread.text],
429          regex.icontains(.,
430                          // 01min , 60secs
431                          '0?[1-9]\s*min(?:(?:ute)?s)?\b',
432                          '\d{1,2}\s*s(?:ec(?:ond)?s)?\b',
433                          // (00:50s)
434                          // 3:26 seconds
435                          '[\(\[]?(?:\d{1,2}[\:\s-])\d{1,2}[\)\]]?\s*(?:s(?:(?:ecs?)onds)?)[\)\]]?',
436                          // 03min25secs
437                          '0?[1-9]\s*min(?:(?:ute)?s)?\d{1,2}\s*s(?:ec(?:ond)?s)?',
438                          // [0:39]
439                          // (0:39)
440                          '[\(\[](?:\d{1,2}[\:\s-])\d{1,2}[\)\]]\s'
441          )
442      )
443      // resuse the same logic against ORC output of message_screenshot
444      or any(filter(file.explode(file.message_screenshot()), .depth == 0),
445             regex.icontains(.scan.ocr.raw,
446                             // 01min , 60secs
447                             '0?[1-9]\s*min(?:(?:ute)?s)?\b',
448                             '\d{1,2}\s*s(?:ec(?:ond)?s)?\b',
449                             // (00:50s)
450                             // 3:26 seconds
451                             '[\(\[]?(?:\d{1,2}[\:\s-])\d{1,2}[\)\]]?\s*(?:s(?:(?:ecs?)onds)?)[\)\]]?',
452                             // 03min25secs
453                             '0?[1-9]\s*min(?:(?:ute)?s)?\d{1,2}\s*s(?:ec(?:ond)?s)?',
454                             // [0:39]
455                             // (0:39)
456                             '[\(\[](?:\d{1,2}[\:\s-])\d{1,2}[\)\]]\s'
457             )
458      )
459    ),
460    // often times the subject or sender display name will contain dates
461    (
462      any([sender.display_name, subject.subject],
463          // days of week
464          any([
465                'monday',
466                'tuesday',
467                'wednesday',
468                'thursday',
469                'friday',
470                'saturday',
471                'sunday'
472              ],
473              strings.icontains(.., .)
474          )
475          // months
476          // may is problematic for words like "Mayor", "Maybe", "MayFlower", etc
477          or any([
478                   "January",
479                   "February",
480                   "March",
481                   "April",
482                   "June",
483                   "July",
484                   "August",
485                   "September",
486                   "October",
487                   "November",
488                   "December"
489                 ],
490                 strings.icontains(.., .)
491          )
492          // use a regex for May
493          or regex.icontains(., '\bmay\b')
494          // common date formats
495          or regex.contains(.,
496                            // YYYY-MM-DD or YY-MM-DD (ISO 8601 format)
497                            '\d{2}(\d{2})?-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])',
498                            // MM/DD/YYYY or MM/DD/YY (US format)
499                            '(0[1-9]|1[0-2])/(0[1-9]|[12]\d|3[01])/\d{2}(\d{2})?',
500                            // DD/MM/YYYY or DD/MM/YY (European format)
501                            '(0[1-9]|[12]\d|3[01])/(0[1-9]|1[0-2])/\d{2}(\d{2})?',
502                            // Month DD, YYYY or Month DD, YY (e.g., March 15, 2024 or March 15, 24)
503                            '(January|February|March|April|May|June|July|August|September|October|November|December) (0[1-9]|[12]\d|3[01]), \d{2}(\d{2})?'
504          )
505          // common time formats
506          or regex.contains(.,
507                            // Example: 23:45, 08:30
508                            '([01]\d|2[0-3]):([0-5]\d)',
509                            // Example: 23:45:59, 08:30:12
510                            '([01]\d|2[0-3]):([0-5]\d):([0-5]\d)',
511                            // Example: 08:30 AM, 12:45 pm
512                            '(0[1-9]|1[0-2]):([0-5]\d)\s?([AaPp][Mm])',
513                            // Example: 08:30 AM, 12:45 pm
514                            '(0[1-9]|1[0-2]):([0-5]\d):([0-5]\d) ?([AaPp][Mm])'
515          )
516      )
517      // or use the OCR results from file.message_screenshot
518      or any(filter(file.explode(file.message_screenshot()), .depth == 0),
519             // days of week
520             any([
521                   'monday',
522                   'tuesday',
523                   'wednesday',
524                   'thursday',
525                   'friday',
526                   'saturday',
527                   'sunday'
528                 ],
529                 strings.icontains(..scan.ocr.raw, .)
530             )
531             // months
532             // may is problematic for words like "Mayor", "Maybe", "MayFlower", etc
533             or any([
534                      "January",
535                      "February",
536                      "March",
537                      "April",
538                      "June",
539                      "July",
540                      "August",
541                      "September",
542                      "October",
543                      "November",
544                      "December"
545                    ],
546                    strings.icontains(..scan.ocr.raw, .)
547             )
548             // use a regex for May
549             or regex.contains(.scan.ocr.raw, '\bMay\b')
550             // common date formats
551             or regex.contains(.scan.ocr.raw,
552                               // YYYY-MM-DD or YY-MM-DD (ISO 8601 format)
553                               '\d{2}(\d{2})?-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])',
554                               // MM/DD/YYYY or MM/DD/YY (US format)
555                               '(0[1-9]|1[0-2])/(0[1-9]|[12]\d|3[01])/\d{2}(\d{2})?',
556                               // DD/MM/YYYY or DD/MM/YY (European format)
557                               '(0[1-9]|[12]\d|3[01])/(0[1-9]|1[0-2])/\d{2}(\d{2})?',
558                               // Month DD, YYYY or Month DD, YY (e.g., March 15, 2024 or March 15, 24)
559                               '(January|February|March|April|May|June|July|August|September|October|November|December) (0[1-9]|[12]\d|3[01]), \d{2}(\d{2})?'
560             )
561             // common time formats
562             or regex.contains(.scan.ocr.raw,
563                               // Example: 23:45, 08:30
564                               '([01]\d|2[0-3]):([0-5]\d)',
565                               // Example: 23:45:59, 08:30:12
566                               '([01]\d|2[0-3]):([0-5]\d):([0-5]\d)',
567                               // Example: 08:30 AM, 12:45 pm
568                               '(0[1-9]|1[0-2]):([0-5]\d)\s?([AaPp][Mm])',
569                               // Example: 08:30 AM, 12:45 pm
570                               '(0[1-9]|1[0-2]):([0-5]\d):([0-5]\d) ?([AaPp][Mm])'
571             )
572      )
573    ),
574    // there are often emoji in the sender display name
575    (
576      any([sender.display_name, subject.subject],
577          // contains an emoji
578          regex.contains(.,
579                         '[\x{1F300}-\x{1F5FF}\x{1F600}-\x{1F64F}\x{1F680}-\x{1F6FF}\x{1F700}-\x{1F77F}\x{1F780}-\x{1F7FF}\x{1F900}-\x{1F9FF}\x{2600}-\x{26FF}\x{2700}-\x{27BF}\x{2300}-\x{23FF}]'
580          )
581          // negate where the emoji occur in tags
582          and not regex.contains(.,
583                                 '^(?:\[[^\]]*\]\s*)*\[[^\]]*[\x{1F300}-\x{1F5FF}\x{1F600}-\x{1F64F}\x{1F680}-\x{1F6FF}\x{1F700}-\x{1F77F}\x{1F780}-\x{1F7FF}\x{1F900}-\x{1F9FF}\x{2600}-\x{26FF}\x{2700}-\x{27BF}\x{2300}-\x{23FF}][^\]]*\]'
584          )
585      )
586    ),
587    // an attachment is a pdf, image, or document that contains a url
588    (
589      1 <= length(attachments) <= 2
590      and any(attachments,
591              (
592                .file_type in $file_types_images
593                or .file_type == "pdf"
594                or .file_extension in $file_extensions_macros
595              )
596              and any(file.explode(.),
597                      .scan.qr.type == "url"
598                      or strings.icontains(.scan.qr.data, 'http')
599                      or any(recipients.to,
600                             strings.icontains(..scan.qr.data, .email.local_part)
601                             or strings.icontains(..scan.qr.data, .email.email)
602                      )
603              )
604      )
605    )
606  )
607  
608  // negating legit replies and legitimate audio file attachments and known voicemail senders
609  and not (
610    sender.email.domain.valid
611    and sender.email.domain.root_domain in (
612      "magicjack.com",
613      "magicjackforbusiness.com",
614      "unitelvoice.com",
615      "voipinterface.net",
616      "ringcentral.biz",
617      "verizonwireless.com",
618      "t-mobile.com",
619      "justcall.io",
620      "airtel.com",
621      "grasshopper.com",
622      "ooma.com",
623      "ui.com"
624    )
625  )
626  and not (
627    any(attachments,
628        strings.starts_with(.content_type, "audio")
629        // confirm the content type with .file_type
630        // we have seen attachments claim to be audio/* files, only to be exploded as something else
631        and .file_type in ("wav", "mp3")
632    )
633  )
634  and not (
635    (
636      strings.istarts_with(subject.subject, "RE:")
637      // out of office auto-reply
638      // the NLU model will handle these better natively soon
639      or strings.istarts_with(subject.subject, "Automatic reply:")
640    )
641    and (length(headers.references) > 0 or headers.in_reply_to is not null)
642  )
643  // bounce-back negations
644  and not any(attachments,
645              any(file.parse_eml(.).attachments,
646                  .content_type == "message/delivery-status"
647              )
648  )
649  // bounce-back negations
650  and not (
651    any(attachments,
652        .content_type in ("message/delivery-status", "text/calendar")
653    )
654  )
655  // negate newsletters
656  and not (
657    (
658      any(ml.nlu_classifier(body.current_thread.text).topics,
659          .name in (
660            "Newsletters and Digests",
661            "B2B Cold Outreach",
662            "Events and Webinars"
663          )
664          and .confidence == "high"
665      )
666    )
667    and not strings.icontains(body.current_thread.text,
668                              "this voicemail was shared by"
669    )
670  )
671  // negate bouncebacks from proofpoint
672  and not (
673    sender.display_name == "Mail Delivery Subsystem"
674    and strings.ends_with(headers.message_id, "pphosted.com>")
675    and any(headers.hops,
676            .index == 0 and strings.contains(.received.server.raw, "pphosted.com")
677    )
678    and any(attachments, .content_type == "message/rfc822")
679  )
680  // negate CheckPoint encrypted messages
681  and not (
682    // CheckPoint banner
683    length(attachments) == 1
684    and any(body.links, .href_url.domain.root_domain == "checkpointcloudsec.com")
685    and strings.istarts_with(headers.message_id, "<encrypted")
686    and any(headers.domains, .root_domain == "checkpointcloudsec.com")
687  )
688  // an impersonated high trust domain
689  and (
690    (
691      sender.email.domain.root_domain in $high_trust_sender_root_domains
692      and not headers.auth_summary.dmarc.pass
693      // service abuse
694      and not sender.email.email in ("noreply-application-integration@google.com")
695    )
696    or sender.email.domain.root_domain not in $high_trust_sender_root_domains
697  
698    // sender profile
699    or (
700      (
701        not sender.email.domain.root_domain in $org_domains
702        and (profile.by_sender_email().prevalence not in ("common"))
703        and not profile.by_sender_email().solicited
704      )
705      or (
706        profile.by_sender_email().any_messages_malicious_or_spam
707        and not profile.by_sender_email().any_messages_benign
708      )
709      // match if the sender is in org domains but failed auth
710      or (
711        sender.email.domain.domain in $org_domains
712        and not coalesce(headers.auth_summary.dmarc.pass, false)
713      )
714      // match if the sender address is blank or null
715      or (regex.match(sender.email.email, "") or sender.email.email is null)
716    )
717  )  
718attack_types:
719  - "Credential Phishing"
720tactics_and_techniques:
721  - "Social engineering"
722detection_methods:
723  - "Content analysis"
724  - "Natural Language Understanding"
725  - "Sender analysis"
726  - "URL analysis"
727related_detections:
728  - "attachment_svg_embedded_js.yml"
729id: "74ba7787-e543-5ce8-b6eb-e1ecdb8f1d67"
to-top