Detection rules › Sublime MQL

Brand impersonation: USPS

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

Impersonation of the United States Postal Service.

Threat classification

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

CategoryValues
Attack typesCredential Phishing
Tactics and techniquesImage as content, Impersonation: Brand, Social engineering

Event coverage

Rule body MQL

type.inbound
and (
  any(ml.logo_detect(file.message_screenshot()).brands, .name == "USPS")
  or strings.icontains(sender.display_name, "USPS")
  or strings.icontains(sender.display_name, "United States Postal Service")
  or regex.contains(body.html.display_text, 'USPS\s*\.\s*COM')
  or strings.icontains(body.current_thread.text, 'USPS Delivery Team')
)
and length(body.links) > 0
and 3 of (
  any(body.links,
      strings.ilike(.display_text,
                    "*check now*",
                    "*track*",
                    "*package*",
                    '*view your order*',
                    "*update*",
                    '*delivery address*',
                    "*parcel allocation*",
                    "*claim your parcel*"
      )
  ),
  strings.ilike(body.current_thread.text,
                "*returned*to*sender*",
                "*redelivery*",
                '*USPS promotions*',
                '*review your package*',
                '*receiver address*',
                '*package details*',
                '*sorry tolet*',
                '*Due to an incorrect*',
                '*remain undeliverable*'
  ),
  // impersonal greeting
  any(ml.nlu_classifier(body.current_thread.text).entities,
      .name == "recipient" and .text =~ "Customer"
  ),
  any(ml.nlu_classifier(body.current_thread.text).intents,
      .name == "cred_theft" and .confidence != "low"
  ),
  // free email sender
  sender.email.domain.root_domain in $free_email_providers,
  network.whois(sender.email.domain).days_old < 30,
  not network.whois(sender.email.domain).found,

  // contains link to recently registered domain
  any(body.links, network.whois(.href_url.domain).days_old < 15),
  (
    regex.icontains(strings.replace_confusables(body.html.display_text),
                    '\b(?:u.?s.?p.?s|shipping|delivery)\b'
    )
    and not regex.icontains(body.html.display_text,
                            '\b(?:usps|shipping|delivery)\b'
    )
  ),
  any(body.links, regex.icontains(.href_url.url, 'https?://[0-9]{7,12}/.+')),
)
and (
  sender.email.domain.root_domain not in (
    "usps.com",
    "opinions-inmoment.com", // https://faq.usps.com/s/article/USPS-Customer-Experience-Surveys
    "shipup.co", // third party shipping company
    "withings.com" // third party shipping company
  )
  or (
    sender.email.domain.root_domain in (
      "usps.com",
      "opinions-inmoment.com" // https://faq.usps.com/s/article/USPS-Customer-Experience-Surveys
    )
    and not headers.auth_summary.dmarc.pass
  )
)
// negate newsletters
and not (
  length(body.links) > 20
  or any(ml.nlu_classifier(body.html.display_text).topics,
         .name == "Newsletters and Digests"
  )
)
// not all links to usps.com
and not all(body.links, .href_url.domain.root_domain == "usps.com")
// negate legit forwards and replies
and not (
  (subject.is_reply or subject.is_forward)
  and length(body.previous_threads) > 0
  and (length(headers.references) > 0 or headers.in_reply_to is not null)
)
// 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 any(body.links,
            regex.icontains(.display_text, 'Track (?:Your Order|Shipment)')
            and .href_url.domain.domain == 'tools.usps.com'
)
and not sender.email.domain.root_domain in ('shopifyemail.com')

Detection logic

Scope: inbound message.

Impersonation of the United States Postal Service.

  1. inbound message
  2. any of:
    • any of ml.logo_detect(file.message_screenshot()).brands where:
      • .name is 'USPS'
    • sender.display_name contains 'USPS'
    • sender.display_name contains 'United States Postal Service'
    • body.html.display_text matches 'USPS\\s*\\.\\s*COM'
    • body.current_thread.text contains 'USPS Delivery Team'
  3. length(body.links) > 0
  4. at least 3 of:
    • any of body.links where:
      • .display_text matches any of 8 patterns
        • *check now*
        • *track*
        • *package*
        • *view your order*
        • *update*
        • *delivery address*
        • *parcel allocation*
        • *claim your parcel*
    • body.current_thread.text matches any of 9 patterns
      • *returned*to*sender*
      • *redelivery*
      • *USPS promotions*
      • *review your package*
      • *receiver address*
      • *package details*
      • *sorry tolet*
      • *Due to an incorrect*
      • *remain undeliverable*
    • any of ml.nlu_classifier(body.current_thread.text).entities where all hold:
      • .name is 'recipient'
      • .text is 'Customer'
    • any of ml.nlu_classifier(body.current_thread.text).intents where all hold:
      • .name is 'cred_theft'
      • .confidence is not 'low'
    • sender.email.domain.root_domain in $free_email_providers
    • network.whois(sender.email.domain).days_old < 30
    • not:
      • network.whois(sender.email.domain).found
    • any of body.links where:
      • network.whois(.href_url.domain).days_old < 15
    • all of:
      • strings.replace_confusables(body.html.display_text) matches '\\b(?:u.?s.?p.?s|shipping|delivery)\\b'
      • not:
        • body.html.display_text matches '\\b(?:usps|shipping|delivery)\\b'
    • any of body.links where:
      • .href_url.url matches 'https?://[0-9]{7,12}/.+'
  5. any of:
    • sender.email.domain.root_domain not in ('usps.com', 'opinions-inmoment.com', 'shipup.co', 'withings.com')
    • all of:
      • sender.email.domain.root_domain in ('usps.com', 'opinions-inmoment.com')
      • not:
        • headers.auth_summary.dmarc.pass
  6. none of:
    • length(body.links) > 20
    • any of ml.nlu_classifier(body.html.display_text).topics where:
      • .name is 'Newsletters and Digests'
  7. not:
    • all of body.links where:
      • .href_url.domain.root_domain is 'usps.com'
  8. not:
    • all of:
      • any of:
        • subject.is_reply
        • subject.is_forward
      • length(body.previous_threads) > 0
      • any of:
        • length(headers.references) > 0
        • headers.in_reply_to is set
  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:
    • any of body.links where all hold:
      • .display_text matches 'Track (?:Your Order|Shipment)'
      • .href_url.domain.domain is 'tools.usps.com'
  11. not:
    • sender.email.domain.root_domain in ('shopifyemail.com')

Inspects: body.current_thread.text, body.html.display_text, body.links, body.links[].display_text, body.links[].href_url.domain, body.links[].href_url.domain.domain, body.links[].href_url.domain.root_domain, body.links[].href_url.url, body.previous_threads, headers.auth_summary.dmarc.pass, headers.in_reply_to, headers.references, sender.display_name, sender.email.domain, sender.email.domain.root_domain, subject.is_forward, subject.is_reply, type.inbound. Sensors: file.message_screenshot, ml.logo_detect, ml.nlu_classifier, network.whois, regex.contains, regex.icontains, strings.icontains, strings.ilike, strings.replace_confusables. Reference lists: $free_email_providers, $high_trust_sender_root_domains.

Indicators matched (37)

FieldMatchValue
ml.logo_detect(file.message_screenshot()).brands[].nameequalsUSPS
strings.icontainssubstringUSPS
strings.icontainssubstringUnited States Postal Service
regex.containsregexUSPS\s*\.\s*COM
strings.icontainssubstringUSPS Delivery Team
strings.ilikesubstring*check now*
strings.ilikesubstring*track*
strings.ilikesubstring*package*
strings.ilikesubstring*view your order*
strings.ilikesubstring*update*
strings.ilikesubstring*delivery address*
strings.ilikesubstring*parcel allocation*
25 more
strings.ilikesubstring*claim your parcel*
strings.ilikesubstring*returned*to*sender*
strings.ilikesubstring*redelivery*
strings.ilikesubstring*USPS promotions*
strings.ilikesubstring*review your package*
strings.ilikesubstring*receiver address*
strings.ilikesubstring*package details*
strings.ilikesubstring*sorry tolet*
strings.ilikesubstring*Due to an incorrect*
strings.ilikesubstring*remain undeliverable*
ml.nlu_classifier(body.current_thread.text).entities[].nameequalsrecipient
ml.nlu_classifier(body.current_thread.text).entities[].textequalsCustomer
ml.nlu_classifier(body.current_thread.text).intents[].nameequalscred_theft
regex.icontainsregex\b(?:u.?s.?p.?s|shipping|delivery)\b
regex.icontainsregex\b(?:usps|shipping|delivery)\b
regex.icontainsregexhttps?://[0-9]{7,12}/.+
sender.email.domain.root_domainmemberusps.com
sender.email.domain.root_domainmemberopinions-inmoment.com
sender.email.domain.root_domainmembershipup.co
sender.email.domain.root_domainmemberwithings.com
ml.nlu_classifier(body.html.display_text).topics[].nameequalsNewsletters and Digests
body.links[].href_url.domain.root_domainequalsusps.com
regex.icontainsregexTrack (?:Your Order|Shipment)
body.links[].href_url.domain.domainequalstools.usps.com
sender.email.domain.root_domainmembershopifyemail.com