Detection rules › Sublime MQL

Brand impersonation: DHL

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

Impersonation of the shipping provider DHL.

Threat classification

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

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

Event coverage

Rule body MQL

type.inbound
and (
  regex.icontains(sender.display_name, '\bDHL\b')
  or (
    strings.ilike(sender.email.domain.domain, '*DHL*')
    and length(sender.email.domain.domain) < 15
  )
  or strings.ilike(subject.subject, '*DHL notification*')
  or regex.icontains(subject.subject, 'dhl? express')
  or regex.contains(subject.subject, '\bD.{0,2}H.{0,2}L.{0,2}\b')
  or (
    any(ml.nlu_classifier(body.current_thread.text).topics,
        .name == "Shipping and Package" and .confidence == "high"
    )
    and strings.contains(body.current_thread.text, 'DHL ')
  )
)
and (
  any(ml.nlu_classifier(body.current_thread.text).entities, .name == "urgency")
  or any(ml.nlu_classifier(body.current_thread.text).entities,
         .name == "org"
         and (
           .text =~ "DHL"
           or .text =~ "DHL Express"
           or strings.istarts_with(.text, "DHL International")
         )
  )
  or any(ml.logo_detect(file.message_screenshot()).brands,
         .name == "DHL" and .confidence in ("medium", "high")
  )
  or regex.icontains(body.current_thread.text, '\bDHL\b')
  // it contains a QR code
  or (
    //
    // This rule makes use of a beta feature and is subject to change without notice
    // using the beta feature in custom rules is not suggested until it has been formally released
    //
    beta.scan_qr(file.message_screenshot()).found
    and any(beta.scan_qr(file.message_screenshot()).items, .type == "url")
  )
  //
  // This rule makes use of a beta feature and is subject to change without notice
  // using the beta feature in custom rules is not suggested until it has been formally released
  //
  or strings.ilike(beta.ocr(file.message_screenshot()).text,
                   "*package*",
                   "*parcel*",
                   "*shipping*",
                   "*delivery*",
                   "*track*"
  )
  or strings.ilike(body.current_thread.text,
                   "*package*",
                   "*parcel*",
                   "*shipping*",
                   "*delivery*",
                   "*track*"
  )
)
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, "RES:")
        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.imatch(subject.subject, '(\[[^\]]+\]\s?){0,3}(re|fwd?)\s?:')
      )
    )
  )
  or length(headers.references) == 0
)
and sender.email.domain.root_domain not in~ (
  'dhl.com',
  'dhl-news.com',
  'bdhllp.com',
  'dhlecommerce.co.uk',
  'dhlparcel.co.uk',
  'dhlecs.com',
  'dhl.co.uk',
  'dhl.co.tz',
  'dpdhl.com',
  'dhl.de',
  'dhl.fr',
  'dhl.pl',
  'dhlexpress.fr', // legit dhl site
  'dhlending.com',
  'inmotion.dhl',
  'dhlparcel.nl',
  'dhltariff.co.uk',
  'dhlindia-kyc.com',
  'dpogroup.com',
  '4flow-service.com', // shipping service
  'leaders-in-logistics.com', // legit sight for leadership webinar events
  'deutschepost.de', // German postal service
  'dhlecommerce.nl',
  'dhl.nl',
  'adhlawfirm.com', // similar name but unrelated
  'attendhlth.com', // dhl in domain but unrelated
  'tdhlaw.com', // dhl in domain but unrelated
  'hapibenefits.com', // DHL rewards program
  'dhlgpi.com', // DHL Australia
  'dhlfreight-news.com'
)
and not (
  sender.email.domain.tld in ('dhl')
  and coalesce(headers.auth_summary.dmarc.pass, false)
)
and (
  profile.by_sender().prevalence in ("new", "outlier")
  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
)

Detection logic

Scope: inbound message.

Impersonation of the shipping provider DHL.

  1. inbound message
  2. any of:
    • sender.display_name matches '\\bDHL\\b'
    • all of:
      • sender.email.domain.domain matches '*DHL*'
      • length(sender.email.domain.domain) < 15
    • subject.subject matches '*DHL notification*'
    • subject.subject matches 'dhl? express'
    • subject.subject matches '\\bD.{0,2}H.{0,2}L.{0,2}\\b'
    • all of:
      • any of ml.nlu_classifier(body.current_thread.text).topics where all hold:
        • .name is 'Shipping and Package'
        • .confidence is 'high'
      • body.current_thread.text contains 'DHL '
  3. any of:
    • any of ml.nlu_classifier(body.current_thread.text).entities where:
      • .name is 'urgency'
    • any of ml.nlu_classifier(body.current_thread.text).entities where all hold:
      • .name is 'org'
      • any of:
        • .text is 'DHL'
        • .text is 'DHL Express'
        • .text starts with 'DHL International'
    • any of ml.logo_detect(file.message_screenshot()).brands where all hold:
      • .name is 'DHL'
      • .confidence in ('medium', 'high')
    • body.current_thread.text matches '\\bDHL\\b'
    • all of:
      • beta.scan_qr(file.message_screenshot()).found
      • any of beta.scan_qr(file.message_screenshot()).items where:
        • .type is 'url'
    • beta.ocr(file.message_screenshot()).text matches any of 5 patterns
      • *package*
      • *parcel*
      • *shipping*
      • *delivery*
      • *track*
    • body.current_thread.text matches any of 5 patterns
      • *package*
      • *parcel*
      • *shipping*
      • *delivery*
      • *track*
  4. 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 'RES:'
        • 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
  5. sender.email.domain.root_domain not in ('dhl.com', 'dhl-news.com', 'bdhllp.com', 'dhlecommerce.co.uk', 'dhlparcel.co.uk', 'dhlecs.com', 'dhl.co.uk', 'dhl.co.tz', 'dpdhl.com', 'dhl.de', 'dhl.fr', 'dhl.pl', 'dhlexpress.fr', 'dhlending.com', 'inmotion.dhl', 'dhlparcel.nl', 'dhltariff.co.uk', 'dhlindia-kyc.com', 'dpogroup.com', '4flow-service.com', 'leaders-in-logistics.com', 'deutschepost.de', 'dhlecommerce.nl', 'dhl.nl', 'adhlawfirm.com', 'attendhlth.com', 'tdhlaw.com', 'hapibenefits.com', 'dhlgpi.com', 'dhlfreight-news.com')
  6. not:
    • all of:
      • sender.email.domain.tld in ('dhl')
      • coalesce(headers.auth_summary.dmarc.pass)
  7. any of:
    • profile.by_sender().prevalence in ('new', 'outlier')
    • all of:
      • profile.by_sender().any_messages_malicious_or_spam
      • not:
        • profile.by_sender().any_messages_benign
  8. 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

Inspects: body.current_thread.text, headers.auth_summary.dmarc.pass, headers.in_reply_to, headers.references, sender.display_name, sender.email.domain.domain, sender.email.domain.root_domain, sender.email.domain.tld, subject.subject, type.inbound. Sensors: beta.ocr, beta.scan_qr, file.message_screenshot, ml.logo_detect, ml.nlu_classifier, profile.by_sender, regex.contains, regex.icontains, regex.imatch, strings.contains, strings.ilike, strings.istarts_with. Reference lists: $high_trust_sender_root_domains.

Indicators matched (62)

FieldMatchValue
regex.icontainsregex\bDHL\b
strings.ilikesubstring*DHL*
strings.ilikesubstring*DHL notification*
regex.icontainsregexdhl? express
regex.containsregex\bD.{0,2}H.{0,2}L.{0,2}\b
ml.nlu_classifier(body.current_thread.text).topics[].nameequalsShipping and Package
ml.nlu_classifier(body.current_thread.text).topics[].confidenceequalshigh
strings.containssubstringDHL
ml.nlu_classifier(body.current_thread.text).entities[].nameequalsurgency
ml.nlu_classifier(body.current_thread.text).entities[].nameequalsorg
ml.nlu_classifier(body.current_thread.text).entities[].textequalsDHL
ml.nlu_classifier(body.current_thread.text).entities[].textequalsDHL Express
50 more
strings.istarts_withprefixDHL International
ml.logo_detect(file.message_screenshot()).brands[].nameequalsDHL
ml.logo_detect(file.message_screenshot()).brands[].confidencemembermedium
ml.logo_detect(file.message_screenshot()).brands[].confidencememberhigh
beta.scan_qr(file.message_screenshot()).items[].typeequalsurl
strings.ilikesubstring*package*
strings.ilikesubstring*parcel*
strings.ilikesubstring*shipping*
strings.ilikesubstring*delivery*
strings.ilikesubstring*track*
strings.istarts_withprefixRE:
strings.istarts_withprefixRES:
strings.istarts_withprefixR:
strings.istarts_withprefixODG:
strings.istarts_withprefix答复:
strings.istarts_withprefixAW:
strings.istarts_withprefixTR:
strings.istarts_withprefixFWD:
regex.imatchregex(\[[^\]]+\]\s?){0,3}(re|fwd?)\s?:
sender.email.domain.root_domainmemberdhl.com
sender.email.domain.root_domainmemberdhl-news.com
sender.email.domain.root_domainmemberbdhllp.com
sender.email.domain.root_domainmemberdhlecommerce.co.uk
sender.email.domain.root_domainmemberdhlparcel.co.uk
sender.email.domain.root_domainmemberdhlecs.com
sender.email.domain.root_domainmemberdhl.co.uk
sender.email.domain.root_domainmemberdhl.co.tz
sender.email.domain.root_domainmemberdpdhl.com
sender.email.domain.root_domainmemberdhl.de
sender.email.domain.root_domainmemberdhl.fr
sender.email.domain.root_domainmemberdhl.pl
sender.email.domain.root_domainmemberdhlexpress.fr
sender.email.domain.root_domainmemberdhlending.com
sender.email.domain.root_domainmemberinmotion.dhl
sender.email.domain.root_domainmemberdhlparcel.nl
sender.email.domain.root_domainmemberdhltariff.co.uk
sender.email.domain.root_domainmemberdhlindia-kyc.com
sender.email.domain.root_domainmemberdpogroup.com
sender.email.domain.root_domainmember4flow-service.com
sender.email.domain.root_domainmemberleaders-in-logistics.com
sender.email.domain.root_domainmemberdeutschepost.de
sender.email.domain.root_domainmemberdhlecommerce.nl
sender.email.domain.root_domainmemberdhl.nl
sender.email.domain.root_domainmemberadhlawfirm.com
sender.email.domain.root_domainmemberattendhlth.com
sender.email.domain.root_domainmembertdhlaw.com
sender.email.domain.root_domainmemberhapibenefits.com
sender.email.domain.root_domainmemberdhlgpi.com
sender.email.domain.root_domainmemberdhlfreight-news.com
sender.email.domain.tldmemberdhl