Detection rules › Sublime MQL
Body: HTML whitespace stuffing with short initial message
Detects messages that uses HTML-based whitespace padding (repeated br tags, p-nbsp blocks, or div-br wrappers) to push content below the visible fold.
Threat classification
Sublime's own taxonomy (not MITRE ATT&CK).
| Category | Values |
|---|---|
| Attack types | Credential Phishing |
| Tactics and techniques | Evasion, Social engineering |
Event coverage
Rule body MQL
type.inbound
// not a legitimate thread reply or is indicative of self sender
and (
(length(headers.references) == 0 and headers.in_reply_to is null)
or (
length(recipients.to) == 1
and length(recipients.cc) == 0
and sender.email.email == recipients.to[0].email.email
)
)
// whitespace-stuffed credphish targets single recipients
and length(recipients.to) == 1
and length(recipients.cc) == 0
and length(recipients.bcc) == 0
// short lure
and length(body.current_thread.text) < 2000
// HTML whitespace stuffing
and (
regex.icontains(body.html.raw, '(?:<br\s*/?\s*>\s*){30,}')
or regex.icontains(body.html.raw,
'(?:<p>\s*(?:&nbsp;|&#160;)\s*</p>\s*){10,}'
)
or regex.icontains(body.html.raw,
'(?:<div[^>]*>\s*<br\s*/?\s*>\s*</div>\s*){20,}'
)
)
// low word count excludes legitimate long threads
and regex.count(body.html.display_text, '\S+') < 3000
// visible link in current thread pointing to external domain
and any(body.current_thread.links,
.href_url.domain.root_domain != sender.email.domain.root_domain
and .href_url.domain.valid
and .href_url.scheme in ("https", "http")
and .visible == true
)
// credential phishing has few visible links - newsletters have many
and length(filter(body.current_thread.links,
.href_url.domain.valid
and .href_url.scheme in ("https", "http")
and .visible == true
)
) < 10
// negate high trust senders that pass auth
and not (
sender.email.domain.root_domain in $high_trust_sender_root_domains
and coalesce(headers.auth_summary.dmarc.pass, false)
)
// negate authenticated senders with unsubscribe mechanism (marketing)
and not (
coalesce(headers.auth_summary.dmarc.pass, false)
and any(body.current_thread.links,
strings.icontains(.display_text, "unsubscribe")
or strings.icontains(.href_url.path, "unsubscribe")
)
)
Detection logic
Scope: inbound message.
Detects messages that uses HTML-based whitespace padding (repeated br tags, p-nbsp blocks, or div-br wrappers) to push content below the visible fold.
- inbound message
any of:
all of:
- length(headers.references) is 0
- headers.in_reply_to is missing
all of:
- length(recipients.to) is 1
- length(recipients.cc) is 0
- sender.email.email is recipients.to[0].email.email
- length(recipients.to) is 1
- length(recipients.cc) is 0
- length(recipients.bcc) is 0
- length(body.current_thread.text) < 2000
any of:
- body.html.raw matches '(?:<br\\s*/?\\s*>\\s*){30,}'
- body.html.raw matches '(?:<p>\\s*(?:&nbsp;|&#160;)\\s*</p>\\s*){10,}'
- body.html.raw matches '(?:<div[^>]*>\\s*<br\\s*/?\\s*>\\s*</div>\\s*){20,}'
- regex.count(body.html.display_text, '\\S+') < 3000
any of
body.current_thread.linkswhere all hold:- .href_url.domain.root_domain is not sender.email.domain.root_domain
- .href_url.domain.valid
- .href_url.scheme in ('https', 'http')
- .visible is True
- length(filter(body.current_thread.links, .href_url.domain.valid and .href_url.scheme in ('https', 'http') and .visible == True)) < 10
not:
all of:
- sender.email.domain.root_domain in $high_trust_sender_root_domains
- coalesce(headers.auth_summary.dmarc.pass)
not:
all of:
- coalesce(headers.auth_summary.dmarc.pass)
any of
body.current_thread.linkswhere any holds:- .display_text contains 'unsubscribe'
- .href_url.path contains 'unsubscribe'
Inspects: body.current_thread.links, body.current_thread.links[].display_text, body.current_thread.links[].href_url.domain.root_domain, body.current_thread.links[].href_url.domain.valid, body.current_thread.links[].href_url.path, body.current_thread.links[].href_url.scheme, body.current_thread.links[].visible, body.current_thread.text, body.html.display_text, body.html.raw, headers.auth_summary.dmarc.pass, headers.in_reply_to, headers.references, recipients.bcc, recipients.cc, recipients.to, recipients.to[0].email.email, sender.email.domain.root_domain, sender.email.email, type.inbound. Sensors: regex.count, regex.icontains, strings.icontains. Reference lists: $high_trust_sender_root_domains.
Indicators matched (7)
| Field | Match | Value |
|---|---|---|
regex.icontains | regex | (?:<br\s*/?\s*>\s*){30,} |
regex.icontains | regex | (?:<p>\s*(?:&nbsp;|&#160;)\s*</p>\s*){10,} |
regex.icontains | regex | (?:<div[^>]*>\s*<br\s*/?\s*>\s*</div>\s*){20,} |
regex.count | regex | \S+ |
body.current_thread.links[].href_url.scheme | member | https |
body.current_thread.links[].href_url.scheme | member | http |
strings.icontains | substring | unsubscribe |