Detection rules › Sublime MQL

Brand impersonation: Internal Revenue Service

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

Detects messages from senders posing as the Internal Revenue Service by checking display name similarity and content indicators from body text and screenshots. Excludes legitimate IRS domains and authenticated senders.

Threat classification

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

CategoryValues
Attack typesBEC/Fraud, Credential Phishing
Tactics and techniquesImpersonation: Brand, Social engineering

Event coverage

Rule body MQL

type.inbound
and (
  // display name contains IRS
  (
    strings.ilike(strings.replace_confusables(sender.display_name),
                  '*internal revenue service*'
    )
    or strings.like(strings.replace_confusables(sender.display_name), 'IRS*')
  )
  // levenshtein distance similar to IRS
  or strings.ilevenshtein(strings.replace_confusables(sender.display_name),
                          'internal revenue service'
  ) <= 1
  or (
    strings.like(strings.replace_confusables(subject.base), '*IRS*')
    and any(ml.nlu_classifier(body.current_thread.text).topics,
            .name == "Government Services" and .confidence != "low"
    )
  )
)
and (
  (
    any(ml.nlu_classifier(body.current_thread.text).topics,
        .name in ("Security and Authentication", "Financial Communications")
        and .confidence == "high"
    )
    and not any(ml.nlu_classifier(body.current_thread.text).topics,
                .name in (
                  "Advertising and Promotions",
                  "Newsletters and Digests",
                  "Political Mail",
                  "Events and Webinars"
                )
                and .confidence != "low"
    )
  )
  or (
    // OCR length is more than 2x the current_thread length
    // indicating that the body is mostly an image
    (
      (length(beta.ocr(file.message_screenshot()).text) + 0.0) / (
        length(body.current_thread.text) + 0.0
      )
    ) > 2
    and length(body.previous_threads) == 0
    and any(ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics,
            .name in ("Security and Authentication", "Financial Communications")
            and .confidence == "high"
    )
    and not any(ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics,
                .name in (
                  "Advertising and Promotions",
                  "Newsletters and Digests",
                  "Political Mail",
                  "Events and Webinars"
                )
                and .confidence != "low"
    )
  )
  or any(ml.nlu_classifier(body.current_thread.text).intents,
         .name == "cred_theft" and .confidence == "high"
  )
  or any(ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).intents,
         .name == "cred_theft" and .confidence == "high"
  )
)
and not (
  (
    length(body.current_thread.text) > 2500
    or any(headers.hops,
           any(.fields,
               .name == 'List-Unsubscribe-Post'
               and .value == 'List-Unsubscribe=One-Click'
           )
    )
  )
  and any(ml.nlu_classifier(body.current_thread.text).intents,
          .name == "benign" and .confidence == "high"
  )
)

// and the sender is not in org_domains or from .gov domains and passes auth
and not (
  sender.email.domain.root_domain in $org_domains
  or (
    (
      sender.email.domain.root_domain in ("govdelivery.com", "ms-cpa.org")
      or sender.email.domain.tld == "gov"
    )
    and headers.auth_summary.dmarc.pass
  )
)
// and the sender is not from high trust sender root domains
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.

Detects messages from senders posing as the Internal Revenue Service by checking display name similarity and content indicators from body text and screenshots. Excludes legitimate IRS domains and authenticated senders.

  1. inbound message
  2. any of:
    • any of:
      • strings.replace_confusables(sender.display_name) matches '*internal revenue service*'
      • strings.replace_confusables(sender.display_name) matches 'IRS*'
    • strings.replace_confusables(sender.display_name) is similar to 'internal revenue service'
    • all of:
      • strings.replace_confusables(subject.base) matches '*IRS*'
      • any of ml.nlu_classifier(body.current_thread.text).topics where all hold:
        • .name is 'Government Services'
        • .confidence is not 'low'
  3. any of:
    • all of:
      • any of ml.nlu_classifier(body.current_thread.text).topics where all hold:
        • .name in ('Security and Authentication', 'Financial Communications')
        • .confidence is 'high'
      • not:
        • any of ml.nlu_classifier(body.current_thread.text).topics where all hold:
          • .name in ('Advertising and Promotions', 'Newsletters and Digests', 'Political Mail', 'Events and Webinars')
          • .confidence is not 'low'
    • all of:
      • length(beta.ocr(file.message_screenshot()).text) + 0.0 / length(body.current_thread.text) + 0.0 > 2
      • length(body.previous_threads) is 0
      • any of ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics where all hold:
        • .name in ('Security and Authentication', 'Financial Communications')
        • .confidence is 'high'
      • not:
        • any of ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics where all hold:
          • .name in ('Advertising and Promotions', 'Newsletters and Digests', 'Political Mail', 'Events and Webinars')
          • .confidence is not 'low'
    • any of ml.nlu_classifier(body.current_thread.text).intents where all hold:
      • .name is 'cred_theft'
      • .confidence is 'high'
    • any of ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).intents where all hold:
      • .name is 'cred_theft'
      • .confidence is 'high'
  4. not:
    • all of:
      • any of:
        • length(body.current_thread.text) > 2500
        • any of headers.hops where:
          • any of .fields where all hold:
            • .name is 'List-Unsubscribe-Post'
            • .value is 'List-Unsubscribe=One-Click'
      • any of ml.nlu_classifier(body.current_thread.text).intents where all hold:
        • .name is 'benign'
        • .confidence is 'high'
  5. none of:
    • sender.email.domain.root_domain in $org_domains
    • all of:
      • any of:
        • sender.email.domain.root_domain in ('govdelivery.com', 'ms-cpa.org')
        • sender.email.domain.tld is 'gov'
      • headers.auth_summary.dmarc.pass
  6. 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, body.previous_threads, headers.auth_summary.dmarc.pass, headers.hops, headers.hops[].fields, headers.hops[].fields[].name, headers.hops[].fields[].value, sender.display_name, sender.email.domain.root_domain, sender.email.domain.tld, subject.base, type.inbound. Sensors: beta.ocr, file.message_screenshot, ml.nlu_classifier, strings.ilevenshtein, strings.ilike, strings.like, strings.replace_confusables. Reference lists: $high_trust_sender_root_domains, $org_domains.

Indicators matched (29)

FieldMatchValue
strings.ilikesubstring*internal revenue service*
strings.likesubstringIRS*
strings.ilevenshteinfuzzyinternal revenue service
strings.likesubstring*IRS*
ml.nlu_classifier(body.current_thread.text).topics[].nameequalsGovernment Services
ml.nlu_classifier(body.current_thread.text).topics[].namememberSecurity and Authentication
ml.nlu_classifier(body.current_thread.text).topics[].namememberFinancial Communications
ml.nlu_classifier(body.current_thread.text).topics[].confidenceequalshigh
ml.nlu_classifier(body.current_thread.text).topics[].namememberAdvertising and Promotions
ml.nlu_classifier(body.current_thread.text).topics[].namememberNewsletters and Digests
ml.nlu_classifier(body.current_thread.text).topics[].namememberPolitical Mail
ml.nlu_classifier(body.current_thread.text).topics[].namememberEvents and Webinars
17 more
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics[].namememberSecurity and Authentication
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics[].namememberFinancial Communications
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics[].confidenceequalshigh
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics[].namememberAdvertising and Promotions
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics[].namememberNewsletters and Digests
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics[].namememberPolitical Mail
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).topics[].namememberEvents and Webinars
ml.nlu_classifier(body.current_thread.text).intents[].nameequalscred_theft
ml.nlu_classifier(body.current_thread.text).intents[].confidenceequalshigh
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).intents[].nameequalscred_theft
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).intents[].confidenceequalshigh
headers.hops[].fields[].nameequalsList-Unsubscribe-Post
headers.hops[].fields[].valueequalsList-Unsubscribe=One-Click
ml.nlu_classifier(body.current_thread.text).intents[].nameequalsbenign
sender.email.domain.root_domainmembergovdelivery.com
sender.email.domain.root_domainmemberms-cpa.org
sender.email.domain.tldequalsgov