Detection rules › Sublime MQL

Attachment: Microsoft 365 credential phishing

Severity
high
Type
rule
Source
github.com/sublime-security/sublime-rules

Looks for messages with an image attachment that contains words related to Microsoft, Office365, and passwords.

Threat classification

Sublime's own taxonomy (not MITRE ATT&CK).

CategoryValues
Attack typesCredential Phishing
Tactics and techniquesImpersonation: Brand, Social engineering

Event coverage

Rule body MQL

type.inbound
and length(filter(attachments, .file_type not in $file_types_images)) == 0
and (
  any(attachments,
      .file_type in $file_types_images
      and any(ml.logo_detect(.).brands, strings.starts_with(.name, "Microsoft"))
  )
  or any(attachments,
         .file_type in $file_types_images
         and any(file.explode(.),
                 strings.ilike(.scan.ocr.raw, "*microsoft*", "*office")
                 and length(.scan.ocr.raw) < 1500
         )
  )
)
and any(attachments,
        .file_type in $file_types_images
        and any(file.explode(.),
                length(filter([
                                "password",
                                "unread messages",
                                "Shared Documents",
                                "expiration",
                                "expire",
                                "expiring",
                                "kindly",
                                "renew",
                                "review",
                                "emails failed",
                                "kicked out",
                                "prevented",
                                "storage",
                                "required now",
                                "cache",
                                "qr code",
                                "security update",
                                "invoice",
                                "retrieve",
                                "blocked"
                              ],
                              strings.icontains(..scan.ocr.raw, .)
                       )
                ) >= 2
                or (
                  any(ml.nlu_classifier(.scan.ocr.raw).intents,
                      .name == "cred_theft" and .confidence == "high"
                  )
                  and length(ml.nlu_classifier(.scan.ocr.raw).entities) > 1
                )
        )
)
and (
  not any(headers.hops,
          .authentication_results.compauth.verdict is not null
          and .authentication_results.compauth.verdict == "pass"
          and sender.email.domain.domain in (
            "microsoft.com",
            "sharepointonline.com"
          )
  )
)

// negate angelbeat urls and microsoft disclaimer links
and (
  length(body.links) > 0
  and not all(body.links,
              .href_url.domain.root_domain in (
                "abeatinfo.com",
                "abeatinvite.com",
                "aka.ms",
                "angelbeat.com"
              )
  )
)

// negate replies
and (
  (
    (length(headers.references) > 0 or headers.in_reply_to is null)
    and not (
      (
        strings.istarts_with(subject.subject, "RE:")
        or strings.istarts_with(subject.subject, "R:")
        or strings.istarts_with(subject.subject, "ODG:")
        or strings.istarts_with(subject.subject, "答复:")
        or strings.istarts_with(subject.subject, "AW:")
        or strings.istarts_with(subject.subject, "TR:")
        or strings.istarts_with(subject.subject, "FWD:")
        or regex.icontains(subject.subject,
                           '^(\[[^\]]+\]\s?){0,3}(re|fwd?)\s?:'
        )
      )
    )
  )
  or length(headers.references) == 0
)
and (
  not profile.by_sender().solicited
  or (
    profile.by_sender().any_messages_malicious_or_spam
    and not profile.by_sender().any_messages_benign
  )
)

// 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.

Looks for messages with an image attachment that contains words related to Microsoft, Office365, and passwords.

  1. inbound message
  2. length(filter(attachments, .file_type not in $file_types_images)) is 0
  3. any of:
    • any of attachments where all hold:
      • .file_type in $file_types_images
      • any of ml.logo_detect(.).brands where:
        • .name starts with 'Microsoft'
    • any of attachments where all hold:
      • .file_type in $file_types_images
      • any of file.explode(.) where all hold:
        • .scan.ocr.raw matches any of 2 patterns
          • *microsoft*
          • *office
        • length(.scan.ocr.raw) < 1500
  4. any of attachments where all hold:
    • .file_type in $file_types_images
    • any of file.explode(.) where any holds:
      • length(filter(['password', 'unread messages', 'Shared Documents', 'expiration', 'expire', 'expiring', 'kindly', 'renew', 'review', 'emails failed', 'kicked out', 'prevented', 'storage', 'required now', 'cache', 'qr code', 'security update', 'invoice', 'retrieve', 'blocked'], strings.icontains(.scan.ocr.raw, .))) ≥ 2
      • all of:
        • any of ml.nlu_classifier(.scan.ocr.raw).intents where all hold:
          • .name is 'cred_theft'
          • .confidence is 'high'
        • length(ml.nlu_classifier(.scan.ocr.raw).entities) > 1
  5. not:
    • any of headers.hops where all hold:
      • .authentication_results.compauth.verdict is set
      • .authentication_results.compauth.verdict is 'pass'
      • sender.email.domain.domain in ('microsoft.com', 'sharepointonline.com')
  6. all of:
    • length(body.links) > 0
    • not:
      • all of body.links where:
        • .href_url.domain.root_domain in ('abeatinfo.com', 'abeatinvite.com', 'aka.ms', 'angelbeat.com')
  7. any of:
    • all of:
      • any of:
        • length(headers.references) > 0
        • headers.in_reply_to is missing
      • none of:
        • subject.subject starts with 'RE:'
        • subject.subject starts with 'R:'
        • subject.subject starts with 'ODG:'
        • subject.subject starts with '答复:'
        • subject.subject starts with 'AW:'
        • subject.subject starts with 'TR:'
        • subject.subject starts with 'FWD:'
        • subject.subject matches '^(\\[[^\\]]+\\]\\s?){0,3}(re|fwd?)\\s?:'
    • length(headers.references) is 0
  8. any of:
    • not:
      • profile.by_sender().solicited
    • all of:
      • profile.by_sender().any_messages_malicious_or_spam
      • not:
        • profile.by_sender().any_messages_benign
  9. 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
  10. not:
    • profile.by_sender().any_messages_benign

Inspects: attachments[].file_type, body.links, body.links[].href_url.domain.root_domain, headers.auth_summary.dmarc.pass, headers.hops, headers.hops[].authentication_results.compauth.verdict, headers.in_reply_to, headers.references, sender.email.domain.domain, sender.email.domain.root_domain, subject.subject, type.inbound. Sensors: file.explode, ml.logo_detect, ml.nlu_classifier, profile.by_sender, regex.icontains, strings.icontains, strings.ilike, strings.istarts_with, strings.starts_with. Reference lists: $file_types_images, $high_trust_sender_root_domains.

Indicators matched (20)

FieldMatchValue
strings.starts_withprefixMicrosoft
strings.ilikesubstring*microsoft*
strings.ilikesubstring*office
ml.nlu_classifier(file.explode(attachments[])[].scan.ocr.raw).intents[].nameequalscred_theft
ml.nlu_classifier(file.explode(attachments[])[].scan.ocr.raw).intents[].confidenceequalshigh
headers.hops[].authentication_results.compauth.verdictequalspass
sender.email.domain.domainmembermicrosoft.com
sender.email.domain.domainmembersharepointonline.com
body.links[].href_url.domain.root_domainmemberabeatinfo.com
body.links[].href_url.domain.root_domainmemberabeatinvite.com
body.links[].href_url.domain.root_domainmemberaka.ms
body.links[].href_url.domain.root_domainmemberangelbeat.com
8 more
strings.istarts_withprefixRE:
strings.istarts_withprefixR:
strings.istarts_withprefixODG:
strings.istarts_withprefix答复:
strings.istarts_withprefixAW:
strings.istarts_withprefixTR:
strings.istarts_withprefixFWD:
regex.icontainsregex^(\[[^\]]+\]\s?){0,3}(re|fwd?)\s?: