Detection rules › Sublime MQL
Sublime MQL rules: tax
| Rule | Severity |
|---|---|
| BEC: Tax document request | medium |
| Tax Form: W-8BEN solicitation | medium |
BEC: Tax document request
#Detects messages requesting W-2 tax documents or related tax information that exhibit authentication failures such as DMARC or SPF failures, or mismatched reply-to addresses. The rule identifies senders using common administrative local parts and filters for messages containing W-2 language combined with request entities detected through natural language processing.
Threat classification
Sublime's own taxonomy (not MITRE ATT&CK).
| Category | Values |
|---|---|
| Attack types | BEC/Fraud |
| Tactics and techniques | Social engineering, Spoofing |
Telemetry coverage
| Platform | Record / event type |
|---|---|
| Sublime | Inbound email message |
Message attributes
Rule body
type.inbound
// searching for common sender emails
and sender.email.local_part in~ (
"contact",
"no-reply",
"noreply",
"info",
"admin"
)
// sender emails unmatched
and (
length(headers.reply_to) > 0
and all(headers.reply_to,
.email.domain.root_domain != sender.email.domain.root_domain
)
)
// subject lines with words correlating to tax information
and (
strings.icontains(subject.base, 'wage')
or strings.icontains(strings.replace_confusables(subject.base), 'Ŵ-2')
or regex.icontains(subject.base, 'tax (?:form|state?ment|year)')
or regex.icontains(subject.base, '\bw-?2?\b')
or regex.icontains(strings.replace_confusables(subject.base), '\birs\b')
)
// body text containing variations of "w2" or "wage statements"
and (
(
strings.icontains(strings.replace_confusables(body.current_thread.text),
'Ẇ-2'
)
or strings.icontains(body.current_thread.text, "wage statements")
or regex.icontains(body.current_thread.text, 'w-?2[a-z]?\b')
)
)
// ml classifying for requests
and any(ml.nlu_classifier(body.current_thread.text).entities,
.name == "request"
)
// exclude legitimate senders or domains
and not any(ml.nlu_classifier(body.current_thread.text).intents,
.name == "benign" and .confidence == "high"
)
and not (
sender.email.domain.domain in $org_domains
and coalesce(headers.auth_summary.dmarc.pass, false)
)
and not (
sender.email.domain.root_domain in (
"excel.com",
"sharepoint.com",
"sharepointonline.com",
"powerpoint.com",
"onenote.com",
"microsoft.com",
"jotform.com",
"wetrasnfer.com"
)
and coalesce(headers.auth_summary.dmarc.pass, false)
)
// negate highly trusted sender domains unless they fail DMARC authentication
and not (
sender.email.domain.root_domain in $high_trust_sender_root_domains
and coalesce(headers.auth_summary.dmarc.pass, false)
)
Detection logic
Scope: inbound message.
Detects messages requesting W-2 tax documents or related tax information that exhibit authentication failures such as DMARC or SPF failures, or mismatched reply-to addresses. The rule identifies senders using common administrative local parts and filters for messages containing W-2 language combined with request entities detected through natural language processing.
- inbound message
- sender.email.local_part in ('contact', 'no-reply', 'noreply', 'info', 'admin')
all of:
- length(headers.reply_to) > 0
all of
headers.reply_towhere:- .email.domain.root_domain is not sender.email.domain.root_domain
any of:
- subject.base contains 'wage'
- strings.replace_confusables(subject.base) contains 'Ŵ-2'
- subject.base matches 'tax (?:form|state?ment|year)'
- subject.base matches '\\bw-?2?\\b'
- strings.replace_confusables(subject.base) matches '\\birs\\b'
any of:
- strings.replace_confusables(body.current_thread.text) contains 'Ẇ-2'
- body.current_thread.text contains 'wage statements'
- body.current_thread.text matches 'w-?2[a-z]?\\b'
any of
ml.nlu_classifier(body.current_thread.text).entitieswhere:- .name is 'request'
not:
any of
ml.nlu_classifier(body.current_thread.text).intentswhere all hold:- .name is 'benign'
- .confidence is 'high'
not:
all of:
- sender.email.domain.domain in $org_domains
- coalesce(headers.auth_summary.dmarc.pass)
not:
all of:
- sender.email.domain.root_domain in ('excel.com', 'sharepoint.com', 'sharepointonline.com', 'powerpoint.com', 'onenote.com', 'microsoft.com', 'jotform.com', 'wetrasnfer.com')
- coalesce(headers.auth_summary.dmarc.pass)
not:
all of:
- sender.email.domain.root_domain in $high_trust_sender_root_domains
- coalesce(headers.auth_summary.dmarc.pass)
Inspects: body.current_thread.text, headers.auth_summary.dmarc.pass, headers.reply_to, headers.reply_to[].email.domain.root_domain, sender.email.domain.domain, sender.email.domain.root_domain, sender.email.local_part, subject.base, type.inbound. Sensors: ml.nlu_classifier, regex.icontains, strings.icontains, strings.replace_confusables. Reference lists: $high_trust_sender_root_domains, $org_domains.
Indicators matched (14)
| Field | Match | Value |
|---|---|---|
sender.email.local_part | member | contact |
sender.email.local_part | member | no-reply |
sender.email.local_part | member | noreply |
sender.email.local_part | member | info |
sender.email.local_part | member | admin |
strings.icontains | substring | wage |
strings.icontains | substring | Ŵ-2 |
regex.icontains | regex | tax (?:form|state?ment|year) |
regex.icontains | regex | \bw-?2?\b |
regex.icontains | regex | \birs\b |
strings.icontains | substring | Ẇ-2 |
strings.icontains | substring | wage statements |
2 more
regex.icontains | regex | w-?2[a-z]?\b |
ml.nlu_classifier(body.current_thread.text).entities[].name | equals | request |
Stages and Predicates
Stage 1: mql_rule
and
not
any(ml.nlu_classifier(body.current_thread.text).intents)
and
ml.nlu_classifier(body.current_thread.text).intents.confidence eq "high"
ml.nlu_classifier(body.current_thread.text).intents.name eq "benign"
not
and
coalesce func_call "coalesce(headers.auth_summary.dmarc.pass)"
sender.email.domain.root_domain in ["excel.com", "jotform.com", "microsoft.com", "onenote.com", "powerpoint.com", "sharepoint.com", "sharepointonline.com", "wetrasnfer.com"]
not
and
coalesce func_call "coalesce(headers.auth_summary.dmarc.pass)"
macro "sender.email.domain.domain in org_domains"
not
and
coalesce func_call "coalesce(headers.auth_summary.dmarc.pass)"
macro "sender.email.domain.root_domain in high_trust_sender_root_domains"
or
body.current_thread.text contains "wage statements"
body.current_thread.text regex_match "w-?2[a-z]?\\b"
strings.replace_confusables(body.current_thread.text) contains "Ẇ-2"
any(ml.nlu_classifier(body.current_thread.text).entities)
ml.nlu_classifier(body.current_thread.text).entities.name eq "request"
or
strings.replace_confusables(subject.base) contains "Ŵ-2"
strings.replace_confusables(subject.base) regex_match "\\birs\\b"
subject.base contains "wage"
subject.base regex_match "\\bw-?2?\\b"
subject.base regex_match "tax (?:form|state?ment|year)"
headers.reply_to length_compare "0"
sender.email.local_part in ["admin", "contact", "info", "no-reply", "noreply"]
type.inbound eq "true"
macro "all(headers.reply_to)"Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
ml.nlu_classifier(body.current_thread.text).intents | array_any | excludes:ml.nlu_classifier(body.current_thread.text).intents | |
sender.email.domain.root_domain | in | excel.com, jotform.com, microsoft.com, onenote.com, powerpoint.com, sharepoint.com, sharepointonline.com, wetrasnfer.com | excludes:sender.email.domain.root_domain |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
body.current_thread.text | contains |
| field:"body.current_thread.text" kind:contains value:"wage statements" |
body.current_thread.text | regex_match |
| field:"body.current_thread.text" kind:regex_match value:"w-?2[a-z]?\b" |
sender.email.local_part | in |
| field:"sender.email.local_part" kind:in |
strings.replace_confusables(body.current_thread.text) | contains |
| field:"strings.replace_confusables(body.current_thread.text)" kind:contains value:"Ẇ-2" |
strings.replace_confusables(subject.base) | contains |
| field:"strings.replace_confusables(subject.base)" kind:contains value:"Ŵ-2" |
strings.replace_confusables(subject.base) | regex_match |
| field:"strings.replace_confusables(subject.base)" kind:regex_match value:"\birs\b" |
subject.base | contains |
| field:"subject.base" kind:contains value:"wage" |
subject.base | regex_match |
| field:"subject.base" kind:regex_match |
type.inbound | eq |
| field:"type.inbound" kind:eq value:"true" |
Tax Form: W-8BEN solicitation
#Detects messages containing references to W-8BEN tax forms, commonly used in tax-related fraud schemes targeting individuals and businesses.
Threat classification
Sublime's own taxonomy (not MITRE ATT&CK).
| Category | Values |
|---|---|
| Attack types | BEC/Fraud, Credential Phishing |
| Tactics and techniques | Social engineering |
Telemetry coverage
| Platform | Record / event type |
|---|---|
| Sublime | Inbound email message |
Message attributes
Rule body
type.inbound
and (
// few links
0 < length(body.links) < 20
and any(body.links, network.whois(.href_url.domain).days_old <= 60)
// fewer unique root domain links
and length(distinct(body.links, .href_url.domain.root_domain)) < 10
// sender domain matches no body domains
and all(body.links,
.href_url.domain.root_domain != sender.email.domain.root_domain
)
)
// sender domain and return path are the same
and (sender.email.domain.root_domain == headers.return_path.domain.domain)
and not (sender.email.domain.root_domain != headers.return_path.domain.domain)
and (
regex.icontains(subject.subject, ".*Foreign Tax*")
or regex.icontains(subject.subject, ".*W-8BEN*")
)
// or any([body.current_thread.text, body.html.display_text, body.plain.raw],
and any([body.current_thread.text],
regex.icontains(.,
'tax form',
'W-8BEN',
'Foreign Tax',
'tax return',
'tax preparation',
'tax documentation',
'regulatory',
'withholding',
'approve',
'non-US tax',
'treaty',
'Renew Documentation',
'Dear Client'
)
)
// Registrant domain registered to China
and (
any(body.links,
network.whois(.href_url.domain).registrant_country_code =~ "CN"
)
or any(body.links,
strings.icontains(network.whois(.href_url.domain).registrant_country,
"china"
)
)
)
// Alibaba Cloud nameservers
and all(network.whois(sender.email.domain).name_servers,
.root_domain == "hichina.com"
)
Detection logic
Scope: inbound message.
Detects messages containing references to W-8BEN tax forms, commonly used in tax-related fraud schemes targeting individuals and businesses.
- inbound message
all of:
all of:
- length(body.links) > 0
- length(body.links) < 20
any of
body.linkswhere:- network.whois(.href_url.domain).days_old ≤ 60
- length(distinct(body.links, .href_url.domain.root_domain)) < 10
all of
body.linkswhere:- .href_url.domain.root_domain is not sender.email.domain.root_domain
- sender.email.domain.root_domain is headers.return_path.domain.domain
not:
- sender.email.domain.root_domain is not headers.return_path.domain.domain
any of:
- subject.subject matches '.*Foreign Tax*'
- subject.subject matches '.*W-8BEN*'
any of
[body.current_thread.text]where:. matches any of 13 patterns
tax formW-8BENForeign Taxtax returntax preparationtax documentationregulatorywithholdingapprovenon-US taxtreatyRenew DocumentationDear Client
any of:
any of
body.linkswhere:- network.whois(.href_url.domain).registrant_country_code is 'CN'
any of
body.linkswhere:- network.whois(.href_url.domain).registrant_country contains 'china'
all of
network.whois(sender.email.domain).name_serverswhere:- .root_domain is 'hichina.com'
Inspects: body.current_thread.text, body.links, body.links[].href_url.domain, body.links[].href_url.domain.root_domain, headers.return_path.domain.domain, sender.email.domain, sender.email.domain.root_domain, subject.subject, type.inbound. Sensors: network.whois, regex.icontains, strings.icontains.
Indicators matched (17)
| Field | Match | Value |
|---|---|---|
regex.icontains | regex | .*Foreign Tax* |
regex.icontains | regex | .*W-8BEN* |
regex.icontains | regex | tax form |
regex.icontains | regex | W-8BEN |
regex.icontains | regex | Foreign Tax |
regex.icontains | regex | tax return |
regex.icontains | regex | tax preparation |
regex.icontains | regex | tax documentation |
regex.icontains | regex | regulatory |
regex.icontains | regex | withholding |
regex.icontains | regex | approve |
regex.icontains | regex | non-US tax |
5 more
regex.icontains | regex | treaty |
regex.icontains | regex | Renew Documentation |
regex.icontains | regex | Dear Client |
strings.icontains | substring | china |
network.whois(sender.email.domain).name_servers[].root_domain | equals | hichina.com |
Stages and Predicates
Stage 1: mql_rule
and
any([body.current_thread.text])
or
[body.current_thread.text] regex_match "Dear Client"
[body.current_thread.text] regex_match "Foreign Tax"
[body.current_thread.text] regex_match "Renew Documentation"
[body.current_thread.text] regex_match "W-8BEN"
[body.current_thread.text] regex_match "approve"
[body.current_thread.text] regex_match "non-US tax"
[body.current_thread.text] regex_match "regulatory"
[body.current_thread.text] regex_match "tax documentation"
[body.current_thread.text] regex_match "tax form"
[body.current_thread.text] regex_match "tax preparation"
[body.current_thread.text] regex_match "tax return"
[body.current_thread.text] regex_match "treaty"
[body.current_thread.text] regex_match "withholding"
or
any(body.links)
network.whois func_call "network.whois(body.links[].href_url.domain).registrant_country_code =~ CN"
any(body.links)
network.whois(body.links[].href_url.domain).registrant_country contains "china"
any(body.links)
network.whois func_call "network.whois(body.links[].href_url.domain).days_old <= 60"
not
sender.email.domain.root_domain cross_field_compare "headers.return_path.domain.domain"
or
subject.subject regex_match ".*Foreign Tax*"
subject.subject regex_match ".*W-8BEN*"
body.links length_compare "0"
body.links length_compare "20"
distinct(body.links, .href_url.domain.root_domain) length_compare "10"
sender.email.domain.root_domain cross_field_compare "headers.return_path.domain.domain"
type.inbound eq "true"
macro "all(body.links)"
macro "all(network.whois(sender.email.domain).name_servers)"Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
sender.email.domain.root_domain | cross_field_compare | headers.return_path.domain.domain | excludes:sender.email.domain.root_domain field:"sender.email.domain.root_domain" value:"headers.return_path.domain.domain" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
sender.email.domain.root_domain | cross_field_compare |
| field:"sender.email.domain.root_domain" kind:cross_field_compare value:"headers.return_path.domain.domain" |
subject.subject | regex_match |
| field:"subject.subject" kind:regex_match |
type.inbound | eq |
| field:"type.inbound" kind:eq value:"true" |