Detection rules › Sublime MQL
Brand impersonation: Microsoft with embedded logo and credential theft language
This rule detects messages impersonating Microsoft via a logo and contains credential theft language. From a new and unsolicited sender.
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
Rule body MQL
type.inbound
and (
(
length(attachments) > 0
and all(attachments,
.file_type in $file_types_images or .file_type == "pdf"
)
)
or length(attachments) == 0
)
and any(ml.logo_detect(file.message_screenshot()).brands,
strings.starts_with(.name, "Microsoft")
)
and (
any(ml.nlu_classifier(body.current_thread.text).intents,
.name == "cred_theft" and .confidence in ("medium", "high")
)
or (
length(body.current_thread.text) == 0
//
// This rule makes use of a beta feature and is subject to change without notice
// using the beta feature in custom rules is not suggested until it has been formally released
//
and any(ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).intents,
.name == "cred_theft" and .confidence in ("medium", "high")
)
)
)
and (
not (
headers.auth_summary.dmarc.pass
and headers.auth_summary.dmarc.details.from.domain in (
"azureadnotifications.us",
"microsoft.com",
"sharepointonline.com",
"cloudappsecurity.com",
"microsoftsupport.com",
"microsoft.onmicrosoft.com",
"yammer.com"
)
)
or headers.auth_summary.dmarc.pass is null
or headers.auth_summary.dmarc.details.from.domain is null
)
and not (
sender.email.domain.domain == "planner.office365.com"
and headers.return_path.email == "noreply@planner.office365.com"
and headers.auth_summary.dmarc.details.from.root_domain == "office365.com"
)
// Microsoft has some legit onmicrosoft domains...
and not (
sender.email.domain.domain == "microsoft.onmicrosoft.com"
and headers.auth_summary.spf.pass
and all(body.links, .href_url.domain.root_domain == "microsoft.com")
)
// message is not from sharepoint actual (additional check in case DMARC check above fails to bail out)
and not (
(
strings.ilike(headers.message_id,
'<Share-*',
'<MassDelete-*',
'<FileDeleteAfterExpiration-*',
'<NotifyOwnerSharedWithExternalUsers*',
'<OneTimePasscode*'
)
and strings.ends_with(headers.message_id, '@odspnotify>')
)
or (
any(headers.hops,
any(.fields,
.name == "X-Google-Original-Message-ID"
and strings.ilike(.value,
'<Share-*',
'<MassDelete-*',
'<FileDeleteAfterExpiration-*',
'<NotifyOwnerSharedWithExternalUsers*',
'<OneTimePasscode*'
)
and strings.ends_with(.value, '@odspnotify>')
)
)
)
)
and (
not profile.by_sender().solicited
or (
profile.by_sender().any_messages_malicious_or_spam
and not profile.by_sender().any_messages_benign
)
)
// negate org domains unless they fail DMARC authentication
and (
(
sender.email.domain.root_domain in $org_domains
and (
not headers.auth_summary.dmarc.pass
// MS quarantine digest emails from an org domain are router "internally" to MS, therefore, there is no authentication information
or not (
headers.auth_summary.dmarc.pass is null
and all(headers.domains,
.root_domain in ("outlook.com", "office365.com")
)
// typical emails from freemail Outlook accounts are from prod.outlook.com
and strings.ends_with(headers.message_id, "protection.outlook.com>")
)
)
)
or sender.email.domain.root_domain not in $org_domains
)
// negate sharepoint file shares with mimecast rewrites
and not (
// rewritten message ID
strings.iends_with(headers.message_id, 'mimecast.lan>')
and all(filter(body.links,
strings.icontains(subject.subject, .display_text)
or .display_text == "Open"
),
.href_url.domain.root_domain in (
"mimecastprotect.com",
"mimecast.com"
)
and any(.href_url.query_params_decoded["domain"],
strings.parse_domain(.).tld == "ms"
or strings.parse_domain(.).root_domain == "sharepoint.com"
)
)
)
// negate highly trusted sender domains unless they fail DMARC authentication
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().any_messages_benign
Detection logic
Scope: inbound message.
This rule detects messages impersonating Microsoft via a logo and contains credential theft language. From a new and unsolicited sender.
- inbound message
any of:
all of:
- length(attachments) > 0
all of
attachmentswhere any holds:- .file_type in $file_types_images
- .file_type is 'pdf'
- length(attachments) is 0
any of
ml.logo_detect(file.message_screenshot()).brandswhere:- .name starts with 'Microsoft'
any of:
any of
ml.nlu_classifier(body.current_thread.text).intentswhere all hold:- .name is 'cred_theft'
- .confidence in ('medium', 'high')
all of:
- length(body.current_thread.text) is 0
any of
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).intentswhere all hold:- .name is 'cred_theft'
- .confidence in ('medium', 'high')
any of:
not:
all of:
- headers.auth_summary.dmarc.pass
- headers.auth_summary.dmarc.details.from.domain in ('azureadnotifications.us', 'microsoft.com', 'sharepointonline.com', 'cloudappsecurity.com', 'microsoftsupport.com', 'microsoft.onmicrosoft.com', 'yammer.com')
- headers.auth_summary.dmarc.pass is missing
- headers.auth_summary.dmarc.details.from.domain is missing
not:
all of:
- sender.email.domain.domain is 'planner.office365.com'
- headers.return_path.email is 'noreply@planner.office365.com'
- headers.auth_summary.dmarc.details.from.root_domain is 'office365.com'
not:
all of:
- sender.email.domain.domain is 'microsoft.onmicrosoft.com'
- headers.auth_summary.spf.pass
all of
body.linkswhere:- .href_url.domain.root_domain is 'microsoft.com'
none of:
all of:
headers.message_id matches any of 5 patterns
<Share-*<MassDelete-*<FileDeleteAfterExpiration-*<NotifyOwnerSharedWithExternalUsers*<OneTimePasscode*
- headers.message_id ends with '@odspnotify>'
any of
headers.hopswhere:any of
.fieldswhere all hold:- .name is 'X-Google-Original-Message-ID'
.value matches any of 5 patterns
<Share-*<MassDelete-*<FileDeleteAfterExpiration-*<NotifyOwnerSharedWithExternalUsers*<OneTimePasscode*
- .value ends with '@odspnotify>'
any of:
not:
- profile.by_sender().solicited
all of:
- profile.by_sender().any_messages_malicious_or_spam
not:
- profile.by_sender().any_messages_benign
any of:
all of:
- sender.email.domain.root_domain in $org_domains
any of:
not:
- headers.auth_summary.dmarc.pass
not:
all of:
- headers.auth_summary.dmarc.pass is missing
all of
headers.domainswhere:- .root_domain in ('outlook.com', 'office365.com')
- headers.message_id ends with 'protection.outlook.com>'
- sender.email.domain.root_domain not in $org_domains
not:
all of:
- headers.message_id ends with 'mimecast.lan>'
all of
filter(body.links)where all hold:- .href_url.domain.root_domain in ('mimecastprotect.com', 'mimecast.com')
any of
.href_url.query_params_decoded['domain']where any holds:- strings.parse_domain(.).tld is 'ms'
- strings.parse_domain(.).root_domain is 'sharepoint.com'
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
not:
- profile.by_sender().any_messages_benign
Inspects: attachments[].file_type, body.current_thread.text, body.links, body.links[].display_text, body.links[].href_url.domain.root_domain, headers.auth_summary.dmarc.details.from.domain, headers.auth_summary.dmarc.details.from.root_domain, headers.auth_summary.dmarc.pass, headers.auth_summary.spf.pass, headers.domains, headers.domains[].root_domain, headers.hops, headers.hops[].fields, headers.hops[].fields[].name, headers.hops[].fields[].value, headers.message_id, headers.return_path.email, sender.email.domain.domain, sender.email.domain.root_domain, subject.subject, type.inbound. Sensors: beta.ocr, file.message_screenshot, ml.logo_detect, ml.nlu_classifier, profile.by_sender, strings.ends_with, strings.icontains, strings.iends_with, strings.ilike, strings.parse_domain, strings.starts_with. Reference lists: $file_types_images, $high_trust_sender_root_domains, $org_domains.
Indicators matched (34)
| Field | Match | Value |
|---|---|---|
attachments[].file_type | equals | pdf |
strings.starts_with | prefix | Microsoft |
ml.nlu_classifier(body.current_thread.text).intents[].name | equals | cred_theft |
ml.nlu_classifier(body.current_thread.text).intents[].confidence | member | medium |
ml.nlu_classifier(body.current_thread.text).intents[].confidence | member | 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 | member | medium |
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).intents[].confidence | member | high |
headers.auth_summary.dmarc.details.from.domain | member | azureadnotifications.us |
headers.auth_summary.dmarc.details.from.domain | member | microsoft.com |
headers.auth_summary.dmarc.details.from.domain | member | sharepointonline.com |
headers.auth_summary.dmarc.details.from.domain | member | cloudappsecurity.com |
22 more
headers.auth_summary.dmarc.details.from.domain | member | microsoftsupport.com |
headers.auth_summary.dmarc.details.from.domain | member | microsoft.onmicrosoft.com |
headers.auth_summary.dmarc.details.from.domain | member | yammer.com |
sender.email.domain.domain | equals | planner.office365.com |
headers.return_path.email | equals | noreply@planner.office365.com |
headers.auth_summary.dmarc.details.from.root_domain | equals | office365.com |
sender.email.domain.domain | equals | microsoft.onmicrosoft.com |
body.links[].href_url.domain.root_domain | equals | microsoft.com |
strings.ilike | substring | <Share-* |
strings.ilike | substring | <MassDelete-* |
strings.ilike | substring | <FileDeleteAfterExpiration-* |
strings.ilike | substring | <NotifyOwnerSharedWithExternalUsers* |
strings.ilike | substring | <OneTimePasscode* |
strings.ends_with | suffix | @odspnotify> |
headers.hops[].fields[].name | equals | X-Google-Original-Message-ID |
headers.domains[].root_domain | member | outlook.com |
headers.domains[].root_domain | member | office365.com |
strings.ends_with | suffix | protection.outlook.com> |
strings.iends_with | suffix | mimecast.lan> |
body.links[].display_text | equals | Open |
filter(body.links)[].href_url.domain.root_domain | member | mimecastprotect.com |
filter(body.links)[].href_url.domain.root_domain | member | mimecast.com |