Detection rules › Sublime MQL

Advance Fee Fraud (AFF) from freemail provider or suspicious TLD

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

Advance Fee Fraud (AFF) is a type of BEC/Fraud involving upfront fees for promised future returns, such as lottery scams, inheritance payouts, and investment opportunities. This rule identifies messages from Freemail domains or suspicious TLDS, including those with suspicious reply-to addresses. It utilizes Natural Language Understanding to detect AFF language in their contents.

Threat classification

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

CategoryValues
Attack typesBEC/Fraud
Tactics and techniquesSocial engineering

Event coverage

Rule body MQL

type.inbound
and (
  sender.email.domain.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 .email.domain.tld in $suspicious_tlds
              or (
                network.whois(.email.domain).days_old < 365
                and length(coalesce(body.html.raw, "")) == 0
              )
            )
            and .email.email != sender.email.email
    )
  )
  or sender.email.domain.tld in $suspicious_tlds
  or any(["jp", "jo"], strings.iends_with(sender.email.domain.tld, .))
  or (
    length(recipients.to) == 0
    and any(headers.reply_to,
            .email.domain.root_domain != sender.email.domain.root_domain
    )
  )
)
and (
  any(ml.nlu_classifier(body.current_thread.text).intents,
      .name == "advance_fee" and .confidence in ("medium", "high")
  )
  or (
    length(body.current_thread.text) < 200
    and regex.icontains(body.current_thread.text,
                        '(?:donation|inheritence|\$\d,\d{3}\,\d{3}|lottery)'
    )
    and not regex.icontains(body.current_thread.text,
                            '(?:closed.{0,50})?\$\d,\d{3}\,\d{3}.{0,100}(?:homes|realty|sale)?'
    )
    and not any(body.links,
                regex.icontains(.href_url.url,
                                '(?:donation|inheritence|\$\d,\d{3}\,\d{3}|lottery)'
                )
    )
    and (
      (
        (length(headers.references) > 0 or headers.in_reply_to is null)
        and not (
          (
            strings.istarts_with(subject.subject, "RE:")
            // out of office auto-reply
            or strings.istarts_with(subject.subject, "Automatic reply:")
            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.icontains(subject.subject,
                               '^(\[[^\]]+\]\s?){0,3}(re|fwd?)\s?:'
            )
          )
        )
      )
      or any(headers.reply_to, .email.email != sender.email.email)
    )
  )
)
and (
  not profile.by_sender().solicited
  or profile.by_sender().any_messages_malicious_or_spam
)
and not profile.by_sender().any_messages_benign

Detection logic

Scope: inbound message.

Advance Fee Fraud (AFF) is a type of BEC/Fraud involving upfront fees for promised future returns, such as lottery scams, inheritance payouts, and investment opportunities. This rule identifies messages from Freemail domains or suspicious TLDS, including those with suspicious reply-to addresses. It utilizes Natural Language Understanding to detect AFF language in their contents.

  1. inbound message
  2. any of:
    • sender.email.domain.domain in $free_email_providers
    • all of:
      • length(headers.reply_to) > 0
      • all of headers.reply_to where all hold:
        • any of:
          • .email.domain.root_domain in $free_email_providers
          • .email.domain.tld in $suspicious_tlds
          • all of:
            • network.whois(.email.domain).days_old < 365
            • length(coalesce(body.html.raw, '')) is 0
        • .email.email is not sender.email.email
    • sender.email.domain.tld in $suspicious_tlds
    • any of ['jp', 'jo'] where:
      • strings.iends_with(sender.email.domain.tld)
    • all of:
      • length(recipients.to) is 0
      • any of headers.reply_to where:
        • .email.domain.root_domain is not sender.email.domain.root_domain
  3. any of:
    • any of ml.nlu_classifier(body.current_thread.text).intents where all hold:
      • .name is 'advance_fee'
      • .confidence in ('medium', 'high')
    • all of:
      • length(body.current_thread.text) < 200
      • body.current_thread.text matches '(?:donation|inheritence|\\$\\d,\\d{3}\\,\\d{3}|lottery)'
      • not:
        • body.current_thread.text matches '(?:closed.{0,50})?\\$\\d,\\d{3}\\,\\d{3}.{0,100}(?:homes|realty|sale)?'
      • not:
        • any of body.links where:
          • .href_url.url matches '(?:donation|inheritence|\\$\\d,\\d{3}\\,\\d{3}|lottery)'
      • 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 'Automatic reply:'
            • 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?:'
        • any of headers.reply_to where:
          • .email.email is not sender.email.email
  4. any of:
    • not:
      • profile.by_sender().solicited
    • profile.by_sender().any_messages_malicious_or_spam
  5. not:
    • profile.by_sender().any_messages_benign

Inspects: body.current_thread.text, body.html.raw, body.links, body.links[].href_url.url, headers.in_reply_to, headers.references, headers.reply_to, headers.reply_to[].email.domain, headers.reply_to[].email.domain.root_domain, headers.reply_to[].email.domain.tld, headers.reply_to[].email.email, recipients.to, sender.email.domain.domain, sender.email.domain.root_domain, sender.email.domain.tld, sender.email.email, subject.subject, type.inbound. Sensors: ml.nlu_classifier, network.whois, profile.by_sender, regex.icontains, strings.iends_with, strings.istarts_with. Reference lists: $free_email_providers, $suspicious_tlds.

Indicators matched (14)

FieldMatchValue
ml.nlu_classifier(body.current_thread.text).intents[].nameequalsadvance_fee
ml.nlu_classifier(body.current_thread.text).intents[].confidencemembermedium
ml.nlu_classifier(body.current_thread.text).intents[].confidencememberhigh
regex.icontainsregex(?:donation|inheritence|\$\d,\d{3}\,\d{3}|lottery)
regex.icontainsregex(?:closed.{0,50})?\$\d,\d{3}\,\d{3}.{0,100}(?:homes|realty|sale)?
strings.istarts_withprefixRE:
strings.istarts_withprefixAutomatic reply:
strings.istarts_withprefixR:
strings.istarts_withprefixODG:
strings.istarts_withprefix答复:
strings.istarts_withprefixAW:
strings.istarts_withprefixTR:
2 more
strings.istarts_withprefixFWD:
regex.icontainsregex^(\[[^\]]+\]\s?){0,3}(re|fwd?)\s?: