Detection rules › Sublime MQL
EML attachment with credential theft language (unknown sender)
Identifies EML attachments that use credential theft language from unknown senders.
Threat classification
Sublime's own taxonomy (not MITRE ATT&CK).
| Category | Values |
|---|---|
| Attack types | Credential Phishing |
| Tactics and techniques | Evasion, Social engineering |
Event coverage
Rule body MQL
type.inbound
// we don't look for links because it could be a QR code
and any(attachments,
(.content_type == "message/rfc822" or .file_extension =~ "eml")
and (
// credential theft language in the attached EML
any(ml.nlu_classifier(file.parse_eml(.).body.current_thread.text).intents,
.name == "cred_theft" and .confidence == "high"
)
// credential theft language in an attachment in the attached EML
or any(file.parse_eml(.).attachments,
any(ml.nlu_classifier(beta.ocr(.).text).intents,
.name == "cred_theft" and .confidence == "high"
)
)
)
and not strings.like(file.parse_eml(.).sender.email.local_part,
"*postmaster*",
"*mailer-daemon*",
"*administrator*"
)
// some systems attach the bounceback this way
and not any(file.parse_eml(.).attachments,
.content_type in (
"message/delivery-status",
"message/feedback-report"
)
)
// negate Microsoft Dynamic Delivery
and not (
length(file.parse_eml(.).attachments) == 0
and strings.icontains(file.parse_eml(.).body.current_thread.text,
"Your attachments are currently being scanned by Safe Attachments"
)
)
// Mimecast Protection attached EMLs when replacing attachments
and not (
(
strings.iends_with(.file_name, 'was removed from this message')
or .file_name == "We found suspicious links"
or .file_name == 'We sent you safe versions of your files'
)
and length(file.parse_eml(.).headers.hops) == 1
and any(file.parse_eml(.).headers.hops[0].fields,
.name == "X-MC-System"
)
and any(file.parse_eml(.).headers.hops[0].fields,
.name == "Content-Type"
and strings.contains(.value, '; boundary="MCBoundary=_')
)
)
)
// exclude bounce backs & read receipts
and not strings.like(sender.email.local_part,
"*postmaster*",
"*mailer-daemon*",
"*administrator*"
)
and not regex.icontains(subject.subject, "^(undelivered|undeliverable|read:)")
and not any(attachments,
.content_type in (
"message/delivery-status",
"message/feedback-report"
)
)
// if the "References" is in the body of the message, it's probably a bounce
and not any(headers.references, strings.contains(body.html.display_text, .))
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
)
// sender address listed as a recipient
or (
length(recipients.to) == 1
and sender.email.email in map(recipients.to, .email.email)
)
)
and not profile.by_sender_email().any_messages_benign
// negate instances where proofpoint sends a review of a reported message via analyzer
and not (
sender.email.email == "analyzer@analyzer.securityeducation.com"
and any(headers.domains, .root_domain == "pphosted.com")
and headers.auth_summary.spf.pass
and headers.auth_summary.dmarc.pass
)
Detection logic
Scope: inbound message.
Identifies EML attachments that use credential theft language from unknown senders.
- inbound message
any of
attachmentswhere all hold:any of:
- .content_type is 'message/rfc822'
- .file_extension is 'eml'
any of:
any of
ml.nlu_classifier(file.parse_eml(.).body.current_thread.text).intentswhere all hold:- .name is 'cred_theft'
- .confidence is 'high'
any of
file.parse_eml(.).attachmentswhere:any of
ml.nlu_classifier(beta.ocr(.).text).intentswhere all hold:- .name is 'cred_theft'
- .confidence is 'high'
not:
file.parse_eml(.).sender.email.local_part matches any of 3 patterns
*postmaster**mailer-daemon**administrator*
not:
any of
file.parse_eml(.).attachmentswhere:- .content_type in ('message/delivery-status', 'message/feedback-report')
not:
all of:
- length(file.parse_eml(.).attachments) is 0
- file.parse_eml(.).body.current_thread.text contains 'Your attachments are currently being scanned by Safe Attachments'
not:
all of:
any of:
- .file_name ends with 'was removed from this message'
- .file_name is 'We found suspicious links'
- .file_name is 'We sent you safe versions of your files'
- length(file.parse_eml(.).headers.hops) is 1
any of
file.parse_eml(.).headers.hops[0].fieldswhere:- .name is 'X-MC-System'
any of
file.parse_eml(.).headers.hops[0].fieldswhere all hold:- .name is 'Content-Type'
- .value contains '; boundary="MCBoundary=_'
not:
sender.email.local_part matches any of 3 patterns
*postmaster**mailer-daemon**administrator*
not:
- subject.subject matches '^(undelivered|undeliverable|read:)'
not:
any of
attachmentswhere:- .content_type in ('message/delivery-status', 'message/feedback-report')
not:
any of
headers.referenceswhere:- strings.contains(body.html.display_text)
any of:
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:
- length(recipients.to) is 1
- sender.email.email in map(recipients.to, .email.email)
not:
- profile.by_sender_email().any_messages_benign
not:
all of:
- sender.email.email is 'analyzer@analyzer.securityeducation.com'
any of
headers.domainswhere:- .root_domain is 'pphosted.com'
- headers.auth_summary.spf.pass
- headers.auth_summary.dmarc.pass
Inspects: attachments[].content_type, attachments[].file_extension, attachments[].file_name, body.html.display_text, headers.auth_summary.dmarc.pass, headers.auth_summary.spf.pass, headers.domains, headers.domains[].root_domain, headers.references, recipients.to, recipients.to[].email.email, sender.email.email, sender.email.local_part, subject.subject, type.inbound. Sensors: beta.ocr, file.parse_eml, ml.nlu_classifier, profile.by_sender_email, regex.icontains, strings.contains, strings.icontains, strings.iends_with, strings.like.
Indicators matched (23)
| Field | Match | Value |
|---|---|---|
attachments[].content_type | equals | message/rfc822 |
attachments[].file_extension | equals | eml |
ml.nlu_classifier(file.parse_eml(attachments[]).body.current_thread.text).intents[].name | equals | cred_theft |
ml.nlu_classifier(file.parse_eml(attachments[]).body.current_thread.text).intents[].confidence | equals | high |
ml.nlu_classifier(beta.ocr(file.parse_eml(attachments[]).attachments[]).text).intents[].name | equals | cred_theft |
ml.nlu_classifier(beta.ocr(file.parse_eml(attachments[]).attachments[]).text).intents[].confidence | equals | high |
strings.like | substring | *postmaster* |
strings.like | substring | *mailer-daemon* |
strings.like | substring | *administrator* |
file.parse_eml(attachments[]).attachments[].content_type | member | message/delivery-status |
file.parse_eml(attachments[]).attachments[].content_type | member | message/feedback-report |
strings.icontains | substring | Your attachments are currently being scanned by Safe Attachments |
11 more
strings.iends_with | suffix | was removed from this message |
attachments[].file_name | equals | We found suspicious links |
attachments[].file_name | equals | We sent you safe versions of your files |
file.parse_eml(attachments[]).headers.hops[0].fields[].name | equals | X-MC-System |
file.parse_eml(attachments[]).headers.hops[0].fields[].name | equals | Content-Type |
strings.contains | substring | ; boundary="MCBoundary=_ |
regex.icontains | regex | ^(undelivered|undeliverable|read:) |
attachments[].content_type | member | message/delivery-status |
attachments[].content_type | member | message/feedback-report |
sender.email.email | equals | analyzer@analyzer.securityeducation.com |
headers.domains[].root_domain | equals | pphosted.com |