Detection rules › Sublime MQL
Low reputation link to auto-downloaded HTML file with smuggling indicators
Message contains a low reputation link to an automatically downloaded HTML file that contains HTML smuggling indicators, such as atob function use, excessive hexadecimal (0x) usage, etc.
Threat classification
Sublime's own taxonomy (not MITRE ATT&CK).
| Category | Values |
|---|---|
| Attack types | Credential Phishing |
| Tactics and techniques | Evasion, Free file host, Free subdomain host, HTML smuggling, Impersonation: Brand, Open redirect, Social engineering |
Event coverage
| Message attribute |
|---|
| body |
| body.links (collection) |
| type |
Rule body MQL
type.inbound
and any(body.links,
(
.href_url.domain.root_domain not in $tranco_1m
or .href_url.domain.domain in $free_file_hosts
or .href_url.domain.root_domain in $free_file_hosts
or .href_url.domain.root_domain in $free_subdomain_hosts
or .href_url.domain.domain in $url_shorteners
or .href_url.domain.domain in $social_landing_hosts
or
// mass mailer link, masks the actual URL
.href_url.domain.root_domain in (
"hubspotlinks.com",
"mandrillapp.com",
"sendgrid.net",
"rs6.net"
)
// Google AMP redirect
or (
.href_url.domain.sld == "google"
and strings.starts_with(.href_url.path, "/amp/")
)
)
// exclude sources of potential FPs
and (
.href_url.domain.root_domain not in (
"svc.ms",
"sharepoint.com",
"1drv.ms",
"microsoft.com",
"aka.ms",
"msftauthimages.net",
"mimecastprotect.com",
"office.com"
)
or any(body.links, .href_url.domain.domain in $free_file_hosts)
)
and .href_url.domain.root_domain not in $org_domains
and .href_url.domain.valid
)
and any(body.links,
any(ml.link_analysis(.).files_downloaded,
any(file.explode(.),
.scan.entropy.entropy >= 5
and (
length(filter(.scan.javascript.identifiers,
strings.like(.,
"document",
"write",
"atob",
"onload"
)
)
) > 2
// usage: document['write'](atob)
or any(.scan.strings.strings,
regex.icontains(., "document.{0,10}write.{0,10}atob")
)
or any(.scan.strings.strings, strings.icount(., "_0x") > 50)
// usage: some_var = atob();
or any(.scan.strings.strings,
regex.icontains(., "=.?atob.*;")
)
// usage: atob(atob
or any(.scan.strings.strings, strings.ilike(., "*atob?atob*"))
// usage: eval(atob)
or any(.scan.strings.strings, strings.ilike(., "*eval?atob*"))
// usage: atob(_0x)
or any(.scan.strings.strings, strings.ilike(., "*atob(?0x*"))
// usage: obfuscating "atob"
or any(.scan.javascript.identifiers,
strings.ilike(., '*ato\u0062*')
)
// usage: document.head.insertAdjacentHTML("beforeend", atob(...
or any(.scan.strings.strings,
strings.ilike(., "*document*insertAdjacentHTML*atob*")
)
)
)
)
)
and (
not profile.by_sender().solicited
or (
profile.by_sender().any_messages_malicious_or_spam
and not profile.by_sender().any_messages_benign
)
)
Detection logic
Scope: inbound message.
Message contains a low reputation link to an automatically downloaded HTML file that contains HTML smuggling indicators, such as atob function use, excessive hexadecimal (0x) usage, etc.
- inbound message
any of
body.linkswhere all hold:any of:
- .href_url.domain.root_domain not in $tranco_1m
- .href_url.domain.domain in $free_file_hosts
- .href_url.domain.root_domain in $free_file_hosts
- .href_url.domain.root_domain in $free_subdomain_hosts
- .href_url.domain.domain in $url_shorteners
- .href_url.domain.domain in $social_landing_hosts
- .href_url.domain.root_domain in ('hubspotlinks.com', 'mandrillapp.com', 'sendgrid.net', 'rs6.net')
all of:
- .href_url.domain.sld is 'google'
- .href_url.path starts with '/amp/'
any of:
- .href_url.domain.root_domain not in ('svc.ms', 'sharepoint.com', '1drv.ms', 'microsoft.com', 'aka.ms', 'msftauthimages.net', 'mimecastprotect.com', 'office.com')
any of
body.linkswhere:- .href_url.domain.domain in $free_file_hosts
- .href_url.domain.root_domain not in $org_domains
- .href_url.domain.valid
any of
body.linkswhere:any of
ml.link_analysis(.).files_downloadedwhere:any of
file.explode(.)where all hold:- .scan.entropy.entropy ≥ 5
any of:
- length(filter(.scan.javascript.identifiers, strings.like(., 'document', 'write', 'atob', 'onload'))) > 2
any of
.scan.strings.stringswhere:- . matches 'document.{0,10}write.{0,10}atob'
any of
.scan.strings.stringswhere:- strings.icount(., '_0x') > 50
any of
.scan.strings.stringswhere:- . matches '=.?atob.*;'
any of
.scan.strings.stringswhere:- . matches '*atob?atob*'
any of
.scan.strings.stringswhere:- . matches '*eval?atob*'
any of
.scan.strings.stringswhere:- . matches '*atob(?0x*'
any of
.scan.javascript.identifierswhere:- . matches '*ato\\u0062*'
any of
.scan.strings.stringswhere:- . matches '*document*insertAdjacentHTML*atob*'
any of:
not:
- profile.by_sender().solicited
all of:
- profile.by_sender().any_messages_malicious_or_spam
not:
- profile.by_sender().any_messages_benign
Inspects: body.links, body.links[].href_url.domain.domain, body.links[].href_url.domain.root_domain, body.links[].href_url.domain.sld, body.links[].href_url.domain.valid, body.links[].href_url.path, type.inbound. Sensors: file.explode, ml.link_analysis, profile.by_sender, regex.icontains, strings.icount, strings.ilike, strings.like, strings.starts_with. Reference lists: $free_file_hosts, $free_subdomain_hosts, $org_domains, $social_landing_hosts, $tranco_1m, $url_shorteners.
Indicators matched (25)
| Field | Match | Value |
|---|---|---|
body.links[].href_url.domain.root_domain | member | hubspotlinks.com |
body.links[].href_url.domain.root_domain | member | mandrillapp.com |
body.links[].href_url.domain.root_domain | member | sendgrid.net |
body.links[].href_url.domain.root_domain | member | rs6.net |
body.links[].href_url.domain.sld | equals | google |
strings.starts_with | prefix | /amp/ |
body.links[].href_url.domain.root_domain | member | svc.ms |
body.links[].href_url.domain.root_domain | member | sharepoint.com |
body.links[].href_url.domain.root_domain | member | 1drv.ms |
body.links[].href_url.domain.root_domain | member | microsoft.com |
body.links[].href_url.domain.root_domain | member | aka.ms |
body.links[].href_url.domain.root_domain | member | msftauthimages.net |
13 more
body.links[].href_url.domain.root_domain | member | mimecastprotect.com |
body.links[].href_url.domain.root_domain | member | office.com |
strings.like | substring | document |
strings.like | substring | write |
strings.like | substring | atob |
strings.like | substring | onload |
regex.icontains | regex | document.{0,10}write.{0,10}atob |
regex.icontains | regex | =.?atob.*; |
strings.ilike | substring | *atob?atob* |
strings.ilike | substring | *eval?atob* |
strings.ilike | substring | *atob(?0x* |
strings.ilike | substring | *ato\u0062* |
strings.ilike | substring | *document*insertAdjacentHTML*atob* |