Detection rules › Sublime MQL
Brand impersonation: Square
Impersonation of Square, typically containing security-related language, secure message notifications, or credential theft indicators from unauthorized senders.
Threat classification
Sublime's own taxonomy (not MITRE ATT&CK).
| Category | Values |
|---|---|
| Attack types | Credential Phishing |
| Tactics and techniques | Impersonation: Brand, Social engineering |
Event coverage
| Message attribute |
|---|
| body.current_thread |
| headers.auth_summary |
| sender |
| sender.email |
| type |
Rule body MQL
type.inbound
and (
// levenshtein distance similar to Square
(
strings.ilevenshtein(strings.replace_confusables(sender.display_name),
'square'
) <= 1
and sender.display_name not in ("SquareX")
)
or any(ml.logo_detect(file.message_screenshot()).brands,
.name == "Square" and .confidence == "high"
)
)
and (
(
any(ml.nlu_classifier(body.current_thread.text).topics,
.name in (
"Security and Authentication",
"Secure Message",
"Reminders and Notifications"
)
and .confidence in ("medium", "high")
)
and not any(ml.nlu_classifier(body.current_thread.text).topics,
.name in ("Newsletters and Digests", "Entertainment and Sports")
and .confidence in ("medium", "high")
)
)
or (
any(ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics,
.name in (
"Security and Authentication",
"Secure Message",
"Reminders and Notifications"
)
and .confidence in ("medium", "high")
and beta.ocr(file.message_screenshot()).text != ""
)
and not any(ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics,
.name in ("Newsletters and Digests", "Entertainment and Sports")
and .confidence in ("medium", "high")
)
)
or any(ml.nlu_classifier(body.current_thread.text).intents,
.name == "cred_theft" and .confidence == "high"
)
or any(ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).intents,
.name == "cred_theft" and .confidence == "high"
)
)
// and the sender is not in org_domains or from Square domains and passes auth
and not (
sender.email.domain.root_domain in $org_domains
or (
sender.email.domain.root_domain in (
"square.com",
"squareup.com",
"block.com"
)
and headers.auth_summary.dmarc.pass
)
)
// and the sender is not from high trust sender root domains
and (
(
sender.email.domain.root_domain in $high_trust_sender_root_domains
and not headers.auth_summary.dmarc.pass
)
or sender.email.domain.root_domain not in $high_trust_sender_root_domains
)
and (
not profile.by_sender().solicited
or not headers.auth_summary.dmarc.pass
or not headers.auth_summary.spf.pass
)
Detection logic
Scope: inbound message.
Impersonation of Square, typically containing security-related language, secure message notifications, or credential theft indicators from unauthorized senders.
- inbound message
any of:
all of:
- strings.replace_confusables(sender.display_name) is similar to 'square'
- sender.display_name not in ('SquareX')
any of
ml.logo_detect(file.message_screenshot()).brandswhere all hold:- .name is 'Square'
- .confidence is 'high'
any of:
all of:
any of
ml.nlu_classifier(body.current_thread.text).topicswhere all hold:- .name in ('Security and Authentication', 'Secure Message', 'Reminders and Notifications')
- .confidence in ('medium', 'high')
not:
any of
ml.nlu_classifier(body.current_thread.text).topicswhere all hold:- .name in ('Newsletters and Digests', 'Entertainment and Sports')
- .confidence in ('medium', 'high')
all of:
any of
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topicswhere all hold:- .name in ('Security and Authentication', 'Secure Message', 'Reminders and Notifications')
- .confidence in ('medium', 'high')
- beta.ocr(file.message_screenshot()).text is not ''
not:
any of
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topicswhere all hold:- .name in ('Newsletters and Digests', 'Entertainment and Sports')
- .confidence in ('medium', 'high')
any of
ml.nlu_classifier(body.current_thread.text).intentswhere all hold:- .name is 'cred_theft'
- .confidence is 'high'
any of
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).intentswhere all hold:- .name is 'cred_theft'
- .confidence is 'high'
none of:
- sender.email.domain.root_domain in $org_domains
all of:
- sender.email.domain.root_domain in ('square.com', 'squareup.com', 'block.com')
- headers.auth_summary.dmarc.pass
any of:
all of:
- sender.email.domain.root_domain in $high_trust_sender_root_domains
not:
- headers.auth_summary.dmarc.pass
- sender.email.domain.root_domain not in $high_trust_sender_root_domains
any of:
not:
- profile.by_sender().solicited
not:
- headers.auth_summary.dmarc.pass
not:
- headers.auth_summary.spf.pass
Inspects: body.current_thread.text, headers.auth_summary.dmarc.pass, headers.auth_summary.spf.pass, sender.display_name, sender.email.domain.root_domain, type.inbound. Sensors: beta.ocr, file.message_screenshot, ml.logo_detect, ml.nlu_classifier, profile.by_sender, strings.ilevenshtein, strings.replace_confusables. Reference lists: $high_trust_sender_root_domains, $org_domains.
Indicators matched (25)
| Field | Match | Value |
|---|---|---|
strings.ilevenshtein | fuzzy | square |
sender.display_name | member | SquareX |
ml.logo_detect(file.message_screenshot()).brands[].name | equals | Square |
ml.logo_detect(file.message_screenshot()).brands[].confidence | equals | high |
ml.nlu_classifier(body.current_thread.text).topics[].name | member | Security and Authentication |
ml.nlu_classifier(body.current_thread.text).topics[].name | member | Secure Message |
ml.nlu_classifier(body.current_thread.text).topics[].name | member | Reminders and Notifications |
ml.nlu_classifier(body.current_thread.text).topics[].confidence | member | medium |
ml.nlu_classifier(body.current_thread.text).topics[].confidence | member | high |
ml.nlu_classifier(body.current_thread.text).topics[].name | member | Newsletters and Digests |
ml.nlu_classifier(body.current_thread.text).topics[].name | member | Entertainment and Sports |
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics[].name | member | Security and Authentication |
13 more
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics[].name | member | Secure Message |
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics[].name | member | Reminders and Notifications |
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics[].confidence | member | medium |
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics[].confidence | member | high |
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics[].name | member | Newsletters and Digests |
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics[].name | member | Entertainment and Sports |
ml.nlu_classifier(body.current_thread.text).intents[].name | equals | cred_theft |
ml.nlu_classifier(body.current_thread.text).intents[].confidence | equals | high |
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).intents[].name | equals | cred_theft |
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).intents[].confidence | equals | high |
sender.email.domain.root_domain | member | square.com |
sender.email.domain.root_domain | member | squareup.com |
sender.email.domain.root_domain | member | block.com |