Detection rules › Sublime MQL

Link: Personalized URL with recipient address on commonly abused web service

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

Detects messages containing links to file hosting or self-service platforms where the recipient's email address is embedded in the URL path, fragment, or base64-encoded components, indicating targeted personalization tactics.

Threat classification

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

CategoryValues
Attack typesCredential Phishing, Malware/Ransomware
Tactics and techniquesFree file host, Social engineering

Event coverage

Rule body MQL

type.inbound
and length(recipients.to) == 1
and recipients.to[0].email.domain.valid
and 0 < length(body.links) < 10
and any(body.links,
        .parser == "hyperlink"
        and (
          // the recipient email is in the url
          (
            strings.icontains(.href_url.path, recipients.to[0].email.email)
            or strings.icontains(.href_url.fragment,
                                 recipients.to[0].email.email
            )
            or any(strings.scan_base64(.href_url.path, ignore_padding=true),
                   strings.icontains(., recipients.to[0].email.email)
            )
            or any(strings.scan_base64(.href_url.fragment, ignore_padding=true),
                   strings.icontains(., recipients.to[0].email.email)
            )
          )
        )
        and (
          (
            .href_url.domain.root_domain in $free_file_hosts
            or .href_url.domain.domain in $free_file_hosts
            or .href_url.domain.root_domain in $free_subdomain_hosts
            or .href_url.domain.domain in $free_subdomain_hosts
            or .href_url.domain.root_domain in $self_service_creation_platform_domains
            or .href_url.domain.domain in $self_service_creation_platform_domains
            or .href_url.domain.root_domain in $url_shorteners
            or .href_url.domain.domain in $url_shorteners
            or .href_url.domain.root_domain == 'sendgrid.net'
            or (
              .href_url.domain.tld in $suspicious_tlds
              and not .href_url.domain.tld in ('me', 'us')
            )
            or network.whois(.href_url.domain).days_old < 30
            or regex.icontains(.href_url.path,
                               '\/(?:wp-(?:admin|includes)\/|redirect)'
            )
          )
          and not .href_url.domain.root_domain in ('geotab.com')
        )
        // the url contains #
        and strings.contains(.href_url.url, '#')

        // the url doesnt contain #? or #/
        and not regex.contains(.href_url.url, '#[/?]')

        // not sharepoint
        and not .href_url.domain.root_domain == 'sharepoint.com'

        // the url doesnt contain campaign params
        and not regex.icontains(.href_url.url,
                                '(?:location|utm_(?:term|source|medium|content|campaign))='
        )
        // too many fp on typeform and no recent tp
        and not .href_url.domain.root_domain == 'typeform.com'

        // no welcome links on frame.io
        and not (
          .href_url.domain.domain == 'accounts.frame.io'
          and .href_url.path == '/welcome'
        )
        // we dont want links with common unsubscribe paths
        and not strings.icontains(.href_url.path, "unsubscribe")
)

// not mimecast email with malicious blocked url in it
and not (
  subject.base == 'A message triggered content policies'
  and strings.icontains(body.current_thread.text, 'Mimecast Services Limited')
)
and not any(ml.nlu_classifier(body.current_thread.text).intents,
            .name == 'benign' and .confidence == 'high'
)
and (
  (
    sender.email.domain.root_domain in $high_trust_sender_root_domains
    and not coalesce(headers.auth_summary.dmarc.pass, false)
  )
  or sender.email.domain.root_domain not in $high_trust_sender_root_domains
)

Detection logic

Scope: inbound message.

Detects messages containing links to file hosting or self-service platforms where the recipient's email address is embedded in the URL path, fragment, or base64-encoded components, indicating targeted personalization tactics.

  1. inbound message
  2. length(recipients.to) is 1
  3. recipients.to[0].email.domain.valid
  4. all of:
    • length(body.links) > 0
    • length(body.links) < 10
  5. any of body.links where all hold:
    • .parser is 'hyperlink'
    • any of:
      • strings.icontains(.href_url.path)
      • strings.icontains(.href_url.fragment)
      • any of strings.scan_base64(.href_url.path) where:
        • strings.icontains(.)
      • any of strings.scan_base64(.href_url.fragment) where:
        • strings.icontains(.)
    • all of:
      • any of:
        • .href_url.domain.root_domain in $free_file_hosts
        • .href_url.domain.domain in $free_file_hosts
        • .href_url.domain.root_domain in $free_subdomain_hosts
        • .href_url.domain.domain in $free_subdomain_hosts
        • .href_url.domain.root_domain in $self_service_creation_platform_domains
        • .href_url.domain.domain in $self_service_creation_platform_domains
        • .href_url.domain.root_domain in $url_shorteners
        • .href_url.domain.domain in $url_shorteners
        • .href_url.domain.root_domain is 'sendgrid.net'
        • all of:
          • .href_url.domain.tld in $suspicious_tlds
          • not:
            • .href_url.domain.tld in ('me', 'us')
        • network.whois(.href_url.domain).days_old < 30
        • .href_url.path matches '\\/(?:wp-(?:admin|includes)\\/|redirect)'
      • not:
        • .href_url.domain.root_domain in ('geotab.com')
    • .href_url.url contains '#'
    • not:
      • .href_url.url matches '#[/?]'
    • not:
      • .href_url.domain.root_domain is 'sharepoint.com'
    • not:
      • .href_url.url matches '(?:location|utm_(?:term|source|medium|content|campaign))='
    • not:
      • .href_url.domain.root_domain is 'typeform.com'
    • not:
      • all of:
        • .href_url.domain.domain is 'accounts.frame.io'
        • .href_url.path is '/welcome'
    • not:
      • .href_url.path contains 'unsubscribe'
  6. not:
    • all of:
      • subject.base is 'A message triggered content policies'
      • body.current_thread.text contains 'Mimecast Services Limited'
  7. not:
    • any of ml.nlu_classifier(body.current_thread.text).intents where all hold:
      • .name is 'benign'
      • .confidence is 'high'
  8. any of:
    • all of:
      • sender.email.domain.root_domain in $high_trust_sender_root_domains
      • not:
        • coalesce(headers.auth_summary.dmarc.pass)
    • sender.email.domain.root_domain not in $high_trust_sender_root_domains

Inspects: body.current_thread.text, body.links, body.links[].href_url.domain, body.links[].href_url.domain.domain, body.links[].href_url.domain.root_domain, body.links[].href_url.domain.tld, body.links[].href_url.fragment, body.links[].href_url.path, body.links[].href_url.url, body.links[].parser, headers.auth_summary.dmarc.pass, recipients.to, recipients.to[0].email.domain.valid, recipients.to[0].email.email, sender.email.domain.root_domain, subject.base, type.inbound. Sensors: ml.nlu_classifier, network.whois, regex.contains, regex.icontains, strings.contains, strings.icontains, strings.scan_base64. Reference lists: $free_file_hosts, $free_subdomain_hosts, $high_trust_sender_root_domains, $self_service_creation_platform_domains, $suspicious_tlds, $url_shorteners.

Indicators matched (18)

FieldMatchValue
body.links[].parserequalshyperlink
body.links[].href_url.domain.root_domainequalssendgrid.net
body.links[].href_url.domain.tldmemberme
body.links[].href_url.domain.tldmemberus
regex.icontainsregex\/(?:wp-(?:admin|includes)\/|redirect)
body.links[].href_url.domain.root_domainmembergeotab.com
strings.containssubstring#
regex.containsregex#[/?]
body.links[].href_url.domain.root_domainequalssharepoint.com
regex.icontainsregex(?:location|utm_(?:term|source|medium|content|campaign))=
body.links[].href_url.domain.root_domainequalstypeform.com
body.links[].href_url.domain.domainequalsaccounts.frame.io
6 more
body.links[].href_url.pathequals/welcome
strings.icontainssubstringunsubscribe
subject.baseequalsA message triggered content policies
strings.icontainssubstringMimecast Services Limited
ml.nlu_classifier(body.current_thread.text).intents[].nameequalsbenign
ml.nlu_classifier(body.current_thread.text).intents[].confidenceequalshigh