Detection rules › Sublime MQL
Link: Credential harvesting with excess padding evasion
Detects inbound messages containing credential-related action links with tall screenshot images and HTML padding techniques used to evade detection. The rule identifies messages with excessive empty div tags, non-breaking spaces, or large margin-top values that artificially increase content height while hiding malicious intent.
Threat classification
Sublime's own taxonomy (not MITRE ATT&CK).
| Category | Values |
|---|---|
| Attack types | Credential Phishing |
| Tactics and techniques | Evasion, Social engineering |
Event coverage
| Message attribute |
|---|
| body.current_thread |
| body.html |
| sender.email |
| type |
Rule body MQL
type.inbound
// CTA link with action-oriented display text pointing to a different domain than the sender
and any(body.current_thread.links,
regex.icontains(.display_text,
'(?:open|sign.?in|log.?in|retain|credential|secure|confirm|accept|release|document)'
)
and .href_url.domain.root_domain != sender.email.domain.root_domain
)
// tall rendered email with low word density
and beta.parse_exif(file.message_screenshot()).image_height > 1500
and beta.parse_exif(file.message_screenshot()).image_height * 100 / regex.count(body.html.display_text,
'\S+'
) > 500
// html whitespace stuffing patterns
and (
// bare div-br blocks repeated 30+ times
regex.icontains(body.html.raw, '(?:<div>\s*<br\s*/?\s*>\s*</div>\s*){30,}')
// style div-br blocks repeated 20+ times
or regex.icontains(body.html.raw,
'(?:<div\s+style="[^"]+"\s*[^>]*>\s*<br\s*/?\s*>\s*</div>\s*){20,}'
)
// class-attributed div-br blocks repeated 20+ times (Outlook elementToProof pattern)
or regex.icontains(body.html.raw,
'(?:<div\s+class="[^"]*"[^>]*>\s*<br\s*/?\s*>\s*</div>\s*){20,}'
)
// p-nbsp blocks repeated 25+ times
or regex.icontains(body.html.raw,
'(?:<p>\s*(?:&nbsp;|&#160;)\s*</p>\s*){25,}'
)
// css margin-top pushdown >= 1500px
or (
regex.icontains(body.html.raw,
'margin-top\s*:\s*(?:1[5-9]\d{2}|[2-9]\d{3}|\d{5,})px'
)
and not regex.icontains(body.html.raw,
'position\s*:\s*absolute[^"]*margin-top\s*:\s*(?:1[5-9]\d{2}|[2-9]\d{3}|\d{5,})px'
)
and not regex.icontains(body.html.raw,
'margin-left\s*:\s*\d{3,}px[^"]*margin-top\s*:\s*(?:1[5-9]\d{2}|[2-9]\d{3}|\d{5,})px'
)
)
)
Detection logic
Scope: inbound message.
Detects inbound messages containing credential-related action links with tall screenshot images and HTML padding techniques used to evade detection. The rule identifies messages with excessive empty div tags, non-breaking spaces, or large margin-top values that artificially increase content height while hiding malicious intent.
- inbound message
any of
body.current_thread.linkswhere all hold:- .display_text matches '(?:open|sign.?in|log.?in|retain|credential|secure|confirm|accept|release|document)'
- .href_url.domain.root_domain is not sender.email.domain.root_domain
- beta.parse_exif(file.message_screenshot()).image_height > 1500
- beta.parse_exif(file.message_screenshot()).image_height * 100 / regex.count(body.html.display_text) > 500
any of:
- body.html.raw matches '(?:<div>\\s*<br\\s*/?\\s*>\\s*</div>\\s*){30,}'
- body.html.raw matches '(?:<div\\s+style="[^"]+"\\s*[^>]*>\\s*<br\\s*/?\\s*>\\s*</div>\\s*){20,}'
- body.html.raw matches '(?:<div\\s+class="[^"]*"[^>]*>\\s*<br\\s*/?\\s*>\\s*</div>\\s*){20,}'
- body.html.raw matches '(?:<p>\\s*(?:&nbsp;|&#160;)\\s*</p>\\s*){25,}'
all of:
- body.html.raw matches 'margin-top\\s*:\\s*(?:1[5-9]\\d{2}|[2-9]\\d{3}|\\d{5,})px'
not:
- body.html.raw matches 'position\\s*:\\s*absolute[^"]*margin-top\\s*:\\s*(?:1[5-9]\\d{2}|[2-9]\\d{3}|\\d{5,})px'
not:
- body.html.raw matches 'margin-left\\s*:\\s*\\d{3,}px[^"]*margin-top\\s*:\\s*(?:1[5-9]\\d{2}|[2-9]\\d{3}|\\d{5,})px'
Inspects: body.current_thread.links, body.current_thread.links[].display_text, body.current_thread.links[].href_url.domain.root_domain, body.html.raw, sender.email.domain.root_domain, type.inbound. Sensors: beta.parse_exif, file.message_screenshot, regex.icontains.
Indicators matched (8)
| Field | Match | Value |
|---|---|---|
regex.icontains | regex | (?:open|sign.?in|log.?in|retain|credential|secure|confirm|accept|release|document) |
regex.icontains | regex | (?:<div>\s*<br\s*/?\s*>\s*</div>\s*){30,} |
regex.icontains | regex | (?:<div\s+style="[^"]+"\s*[^>]*>\s*<br\s*/?\s*>\s*</div>\s*){20,} |
regex.icontains | regex | (?:<div\s+class="[^"]*"[^>]*>\s*<br\s*/?\s*>\s*</div>\s*){20,} |
regex.icontains | regex | (?:<p>\s*(?:&nbsp;|&#160;)\s*</p>\s*){25,} |
regex.icontains | regex | margin-top\s*:\s*(?:1[5-9]\d{2}|[2-9]\d{3}|\d{5,})px |
regex.icontains | regex | position\s*:\s*absolute[^"]*margin-top\s*:\s*(?:1[5-9]\d{2}|[2-9]\d{3}|\d{5,})px |
regex.icontains | regex | margin-left\s*:\s*\d{3,}px[^"]*margin-top\s*:\s*(?:1[5-9]\d{2}|[2-9]\d{3}|\d{5,})px |