Detection rules › Sublime MQL
HTML smuggling containing recipient email address
HTML attachment (or HTML attachment in attached email) is small and contains a recipients email address.
Threat classification
Sublime's own taxonomy (not MITRE ATT&CK).
| Category | Values |
|---|---|
| Attack types | Credential Phishing, Malware/Ransomware |
| Tactics and techniques | Evasion, HTML smuggling, Scripting |
Event coverage
Rule body MQL
type.inbound
and (
any(attachments,
(
.file_extension in~ ("html", "htm", "shtml", "dhtml")
or .content_type == "message/rfc822"
or .file_type == "html"
or (.content_type == "text/html" or .file_extension in ('eml'))
)
and any(file.explode(.),
.size < 10000
and length(.scan.strings.strings) < 20
and any(recipients.to,
any(..scan.strings.strings,
strings.icontains(., ..email.email)
)
and .email.domain.valid
)
)
)
or any(attachments,
(.file_extension in~ $file_extensions_common_archives)
and any(file.explode(.),
(
.file_extension in~ ("html", "htm", "shtml", "dhtml")
or ..file_type == "html"
or ..content_type == "text/html"
)
and .size < 10000
and length(.scan.strings.strings) < 20
and any(recipients.to,
any(..scan.strings.strings,
strings.icontains(., ..email.email)
)
and .email.domain.valid
)
)
)
)
and not any(attachments,
any(file.parse_eml(.).attachments,
.content_type == "message/delivery-status"
)
)
// bounce-back negations
and not (
any(attachments,
.content_type in ("message/delivery-status", "text/calendar")
)
)
// negate bouncebacks from proofpoint
and not (
sender.display_name == "Mail Delivery Subsystem"
and strings.ends_with(headers.message_id, "pphosted.com>")
and any(headers.hops,
.index == 0 and strings.contains(.received.server.raw, "pphosted.com")
)
and any(attachments, .content_type == "message/rfc822")
)
// unsolicited or fails authentation
and (
(
profile.by_sender_email().prevalence in ("new", "outlier")
and not profile.by_sender_email().solicited
)
or (
profile.by_sender_email().any_messages_malicious_or_spam
and not profile.by_sender_email().any_messages_benign
)
or (
sender.email.domain.domain in $org_domains
and not coalesce(headers.auth_summary.dmarc.pass, false)
)
)
// negate highly trusted sender domains unless they fail DMARC authentication
and (
(
sender.email.domain.root_domain in $high_trust_sender_root_domains
and not coalesce(headers.auth_summary.dmarc.pass, false)
)
or sender.email.domain.root_domain not in $high_trust_sender_root_domains
)
Detection logic
Scope: inbound message.
HTML attachment (or HTML attachment in attached email) is small and contains a recipients email address.
- inbound message
any of:
any of
attachmentswhere all hold:any of:
- .file_extension in ('html', 'htm', 'shtml', 'dhtml')
- .content_type is 'message/rfc822'
- .file_type is 'html'
any of:
- .content_type is 'text/html'
- .file_extension in ('eml')
any of
file.explode(.)where all hold:- .size < 10000
- length(.scan.strings.strings) < 20
any of
recipients.towhere all hold:any of
.scan.strings.stringswhere:- strings.icontains(.)
- .email.domain.valid
any of
attachmentswhere all hold:- .file_extension in $file_extensions_common_archives
any of
file.explode(.)where all hold:any of:
- .file_extension in ('html', 'htm', 'shtml', 'dhtml')
- .file_type is 'html'
- .content_type is 'text/html'
- .size < 10000
- length(.scan.strings.strings) < 20
any of
recipients.towhere all hold:any of
.scan.strings.stringswhere:- strings.icontains(.)
- .email.domain.valid
not:
any of
attachmentswhere:any of
file.parse_eml(.).attachmentswhere:- .content_type is 'message/delivery-status'
not:
any of
attachmentswhere:- .content_type in ('message/delivery-status', 'text/calendar')
not:
all of:
- sender.display_name is 'Mail Delivery Subsystem'
- headers.message_id ends with 'pphosted.com>'
any of
headers.hopswhere all hold:- .index is 0
- .received.server.raw contains 'pphosted.com'
any of
attachmentswhere:- .content_type is 'message/rfc822'
any of:
all of:
- profile.by_sender_email().prevalence in ('new', 'outlier')
not:
- profile.by_sender_email().solicited
all of:
- profile.by_sender_email().any_messages_malicious_or_spam
not:
- profile.by_sender_email().any_messages_benign
all of:
- sender.email.domain.domain in $org_domains
not:
- coalesce(headers.auth_summary.dmarc.pass)
any of:
all of:
- sender.email.domain.root_domain in $high_trust_sender_root_domains
not:
- coalesce(headers.auth_summary.dmarc.pass)
- sender.email.domain.root_domain not in $high_trust_sender_root_domains
Inspects: attachments[].content_type, attachments[].file_extension, attachments[].file_type, headers.auth_summary.dmarc.pass, headers.hops, headers.hops[].index, headers.hops[].received.server.raw, headers.message_id, recipients.to, recipients.to[].email.domain.valid, recipients.to[].email.email, sender.display_name, sender.email.domain.domain, sender.email.domain.root_domain, type.inbound. Sensors: file.explode, file.parse_eml, profile.by_sender_email, strings.contains, strings.ends_with, strings.icontains. Reference lists: $file_extensions_common_archives, $high_trust_sender_root_domains, $org_domains.
Indicators matched (18)
| Field | Match | Value |
|---|---|---|
attachments[].file_extension | member | html |
attachments[].file_extension | member | htm |
attachments[].file_extension | member | shtml |
attachments[].file_extension | member | dhtml |
attachments[].content_type | equals | message/rfc822 |
attachments[].file_type | equals | html |
attachments[].content_type | equals | text/html |
attachments[].file_extension | member | eml |
file.explode(attachments[])[].file_extension | member | html |
file.explode(attachments[])[].file_extension | member | htm |
file.explode(attachments[])[].file_extension | member | shtml |
file.explode(attachments[])[].file_extension | member | dhtml |
6 more
file.parse_eml(attachments[]).attachments[].content_type | equals | message/delivery-status |
attachments[].content_type | member | message/delivery-status |
attachments[].content_type | member | text/calendar |
sender.display_name | equals | Mail Delivery Subsystem |
strings.ends_with | suffix | pphosted.com> |
strings.contains | substring | pphosted.com |