Detection rules › Sublime MQL

Brand impersonation: Microsoft fake sign-in alert

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

Detects messages impersonating Microsoft that mimic sign-in security alerts and attempt to solicit a response.

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
// no links found in body
and length(body.links) == 0
// Microsoft strings
and (
  strings.contains(subject.subject, "Microsoft")
  or strings.contains(sender.display_name, "Microsoft")
  or strings.contains(body.current_thread.text, "Microsoft")
  or (

    // or Microsoft Brand logo
    any(attachments,
        .file_type in $file_types_images
        and any(ml.logo_detect(.).brands,
                strings.starts_with(.name, "Microsoft")
        )
    )
  )
)

// Body contains Indicators of fake sign in notification
and (
  regex.contains(body.current_thread.text,
                 '(Country.region:.{0,20}IP address:|Platform:.{0,20}Browser:)'
  )
  or regex.contains(body.current_thread.text, "Unusual.{0,10}activity")
)
and (

  // If the sender is freemail
  sender.email.domain.domain in $free_email_providers
  or (

    // sender is not freemail, but the return path email or reply to email is  
    sender.email.domain.domain not in $free_email_providers
    and (
      headers.return_path.domain.root_domain in $free_email_providers
      or (
        length(headers.reply_to) > 0
        and (
          all(headers.reply_to,
              .email.domain.root_domain in $free_email_providers
          )
        )
      )
      or (

        // if all replyto domain, return_path domain, sender domain mismatch
        length(headers.reply_to) > 0
        and all(headers.reply_to,
                .email.domain.domain != headers.return_path.domain.domain
                and headers.return_path.domain.domain != sender.email.domain.domain
        )
      )

      // or the domain is less than 90 days old
      or network.whois(sender.email.domain).days_old <= 90
      or (

        // or Compauth verdict is not pass/softpass
        any(headers.hops,
            .authentication_results.compauth.verdict is not null
            and .authentication_results.compauth.verdict not in (
              "pass",
              "softpass"
            )
        )
      )
    )
  )
)
and sender.email.domain.root_domain not in (
  "bing.com",
  "microsoft.com",
  "microsoftonline.com",
  "microsoftsupport.com",
  "microsoft365.com",
  "office.com",
  "onedrive.com",
  "sharepointonline.com",
  "yammer.com",
)

Detection logic

Scope: inbound message.

Detects messages impersonating Microsoft that mimic sign-in security alerts and attempt to solicit a response.

  1. inbound message
  2. length(body.links) is 0
  3. any of:
    • subject.subject contains 'Microsoft'
    • sender.display_name contains 'Microsoft'
    • body.current_thread.text contains 'Microsoft'
    • any of attachments where all hold:
      • .file_type in $file_types_images
      • any of ml.logo_detect(.).brands where:
        • .name starts with 'Microsoft'
  4. any of:
    • body.current_thread.text matches '(Country.region:.{0,20}IP address:|Platform:.{0,20}Browser:)'
    • body.current_thread.text matches 'Unusual.{0,10}activity'
  5. any of:
    • sender.email.domain.domain in $free_email_providers
    • all of:
      • sender.email.domain.domain not in $free_email_providers
      • any of:
        • headers.return_path.domain.root_domain in $free_email_providers
        • all of:
          • length(headers.reply_to) > 0
          • all of headers.reply_to where:
            • .email.domain.root_domain in $free_email_providers
        • all of:
          • length(headers.reply_to) > 0
          • all of headers.reply_to where all hold:
            • .email.domain.domain is not headers.return_path.domain.domain
            • headers.return_path.domain.domain is not sender.email.domain.domain
        • network.whois(sender.email.domain).days_old ≤ 90
        • any of headers.hops where all hold:
          • .authentication_results.compauth.verdict is set
          • .authentication_results.compauth.verdict not in ('pass', 'softpass')
  6. sender.email.domain.root_domain not in ('bing.com', 'microsoft.com', 'microsoftonline.com', 'microsoftsupport.com', 'microsoft365.com', 'office.com', 'onedrive.com', 'sharepointonline.com', 'yammer.com')

Inspects: attachments[].file_type, body.current_thread.text, body.links, headers.hops, headers.hops[].authentication_results.compauth.verdict, headers.reply_to, headers.reply_to[].email.domain.domain, headers.reply_to[].email.domain.root_domain, headers.return_path.domain.domain, headers.return_path.domain.root_domain, sender.display_name, sender.email.domain, sender.email.domain.domain, sender.email.domain.root_domain, subject.subject, type.inbound. Sensors: ml.logo_detect, network.whois, regex.contains, strings.contains, strings.starts_with. Reference lists: $file_types_images, $free_email_providers.

Indicators matched (15)

FieldMatchValue
strings.containssubstringMicrosoft
strings.starts_withprefixMicrosoft
regex.containsregex(Country.region:.{0,20}IP address:|Platform:.{0,20}Browser:)
regex.containsregexUnusual.{0,10}activity
headers.hops[].authentication_results.compauth.verdictmemberpass
headers.hops[].authentication_results.compauth.verdictmembersoftpass
sender.email.domain.root_domainmemberbing.com
sender.email.domain.root_domainmembermicrosoft.com
sender.email.domain.root_domainmembermicrosoftonline.com
sender.email.domain.root_domainmembermicrosoftsupport.com
sender.email.domain.root_domainmembermicrosoft365.com
sender.email.domain.root_domainmemberoffice.com
3 more
sender.email.domain.root_domainmemberonedrive.com
sender.email.domain.root_domainmembersharepointonline.com
sender.email.domain.root_domainmemberyammer.com