Spam: Default Microsoft Exchange Online sender domain (onmicrosoft.com)
The default Microsoft Exchange Online sender domain, onmicrosoft.com, is commonly used to send unwanted and malicious email. Enable this rule in your environment if receiving email from the onmicrosoft.com domain is unexpected behaviour.
Sublime rule (View on GitHub)
1name: "Spam: Default Microsoft Exchange Online sender domain (onmicrosoft.com)"
2description: "The default Microsoft Exchange Online sender domain, onmicrosoft.com, is commonly used to send unwanted and malicious email. Enable this rule in your environment if receiving email from the onmicrosoft.com domain is unexpected behaviour."
3type: "rule"
4severity: "low"
5source: |
6 type.inbound
7 and (
8 sender.email.domain.root_domain == "onmicrosoft.com"
9 or (
10 strings.icontains(sender.display_name, "onmicrosoft.com")
11 and sender.email.domain.valid == false
12 )
13 )
14 and length(recipients.to) < 2
15 and length(body.links) > 0
16 // bounce-back negations
17 and not strings.like(sender.email.local_part, "*postmaster*", "*mailer-daemon*", "*administrator*")
18 and not any(attachments,
19 .content_type in (
20 "message/rfc822",
21 "message/delivery-status",
22 "text/calendar"
23 )
24 or (.content_type == "text/plain" and .file_extension == "ics")
25 )
26 // negating legit replies
27 and not (
28 (
29 strings.istarts_with(subject.subject, "RE:")
30 or strings.istarts_with(subject.subject, "FW:")
31 or strings.istarts_with(subject.subject, "FWD:")
32 or regex.imatch(subject.subject, '(\[[^\]]+\]\s?){0,3}(re|fwd?|automat.*)\s?:.*')
33 or strings.istarts_with(subject.subject, "Réponse automatique")
34 )
35 and (
36 length(headers.references) > 0
37 and any(headers.hops, any(.fields, strings.ilike(.name, "In-Reply-To")))
38 )
39 )
40 // construct the proper sender domain and check against known recipients
41 and not strings.concat(sender.email.domain.subdomain, ".", sender.email.domain.tld) in $recipient_domains
42 and (
43 not profile.by_sender().solicited
44 or (
45 profile.by_sender().any_messages_malicious_or_spam
46 and not profile.by_sender().any_false_positives
47 )
48 )
49 and not sender.email.domain.domain in $org_domains
50tags:
51 - "Attack surface reduction"
52attack_types:
53 - "Callback Phishing"
54 - "Credential Phishing"
55 - "Spam"
56tactics_and_techniques:
57 - "Free email provider"
58 - "Impersonation: Brand"
59 - "Social engineering"
60detection_methods:
61 - "Content analysis"
62 - "Sender analysis"
63id: "3f2a64ce-28bf-505e-a366-204241610ff9"