Detection rules › Sublime MQL

Brand impersonation: DocuSign branded attachment lure with no DocuSign links

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

Detects DocuSign phishing messages with no DocuSign links, a DocuSign logo or verbage within an image or PDF attachment, from an untrusted sender.

Threat classification

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

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

Event coverage

Rule body MQL

type.inbound
and (
  (
    0 < length(attachments) <= 8
    and length(filter(attachments, .file_type in $file_types_images)) > 0
  )
  or (
    length(attachments) > 0
    and all(attachments,
            .file_type in $file_types_images
            or .file_type == 'pdf'
            or (
              .file_extension == "ics"
              or .content_type in ("text/calendar", "application/ics")
            )
    )
  )
)
and (
  // if there are links, ensure they are not docusign links
  (
    length(body.links) != 0
    and any(body.links,
            not strings.ilike(.href_url.domain.root_domain, "docusign.*")
    )
  )
  // sometimes there are no body links and it's all in the PDF attachment
  or length(body.links) == 0
)
and (
  // check the image or pdf attachments for Docusign 
  any(filter(attachments,
             .file_type in $file_types_images or .file_type == 'pdf'
      ),
      (
        any(ml.logo_detect(.).brands, .name == "DocuSign")
        or any(file.explode(.),
               strings.ilike(.scan.ocr.raw, "*DocuSign*")
               and (
                 any(ml.nlu_classifier(.scan.ocr.raw).intents,
                     .name == "cred_theft" and .confidence != "low"
                 )
                 or (
                   regex.icontains(.scan.ocr.raw,
                                   "((re)?view|access|complete(d)?) document(s)?",
                                   '[^d][^o][^cd][^ue]sign(?:\b|ature)',
                                   "important edocs",
                                   // German (Document (check|check|sign|sent))
                                   "Dokument (überprüfen|prüfen|unterschreiben|geschickt)",
                                   // German (important|urgent|immediate)
                                   "(wichtig|dringend|sofort)"
                   )
                   and any(ml.nlu_classifier(.scan.ocr.raw).topics,
                           .name == "E-Signature"
                   )
                   and not strings.count(.scan.ocr.raw, "\n\n\n\n\n\n\n\n\n\n") > 3
                 )
               )
        )
      )
      and not any(file.explode(.),
                  strings.ilike(.scan.ocr.raw,
                                "*DocuSigned By*",
                                "*DocuSign Envelope ID*",
                                "*Certificate Of Completion*",
                                "*Adobe Sign*",
                                // Additional Adobe Acrobat Sign check
                                "*Powered by\nAdobe\nAcrobat Sign*"
                  )
                  or (
                    .depth == 0
                    and (
                      (
                        .scan.exiftool.page_count > 10
                        and length(.scan.strings.strings) > 8000
                      )
                      or (
                        .scan.exiftool.producer == "Acrobat Sign"
                        and any(.scan.exiftool.fields,
                                .key == "SigningReason"
                                and .value == "Certified by Adobe Acrobat Sign"
                        )
                      )
                    )
                  )
                  // negate resume related messages
                  or (
                    any(ml.nlu_classifier(body.current_thread.text).topics,
                        .name == "Professional and Career Development"
                        and .confidence == "high"
                    )
                    and any(ml.nlu_classifier(.scan.ocr.raw).intents,
                            .name == "benign" and .confidence != "low"
                    )
                  )
      )
  )

  // accomidate truncated pngs and GIF files which can cause logodetect/OCR failures
  or (
    any(attachments,
        .file_type =~ "gif"
        //
        // 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 any(beta.parse_exif(.).fields,
               .key == "Warning" and .value == "Truncated PNG image"
        )
    )
    and (
      any(ml.logo_detect(file.message_screenshot()).brands, .name == "DocuSign")
      //
      // 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, "*DocuSign*")
    )
    and (
      (
        any(ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).intents,
            .name == "cred_theft" and .confidence != "low"
        )
        or regex.icontains(beta.ocr(file.message_screenshot()).text,
                           "((re)?view|access|complete(d)?) document(s)?",
                           "[^d][^o][^c][^u]sign",
                           "important edocs",
                           // German (Document (check|check|sign|sent))
                           "Dokument (überprüfen|prüfen|unterschreiben|geschickt)",
                           // German (important|urgent|immediate)
                           "(wichtig|dringend|sofort)"
        )
      )
    )
    and not strings.ilike(beta.ocr(file.message_screenshot()).text,
                          "*DocuSigned By*",
                          "*DocuSign Envelope ID*",
                          "*Certificate Of Completion*",
                          "*Adobe Sign*"
    )
  )
)
and (
  not profile.by_sender_email().solicited
  or profile.by_sender_email().prevalence == "new"
  or (
    profile.by_sender_email().any_messages_malicious_or_spam
    and not profile.by_sender_email().any_messages_benign
  )
)
and not profile.by_sender_email().any_messages_benign

// negate docusign 'via' messages
and not (
  any(headers.hops,
      any(.fields,
          .name == "X-Api-Host" and strings.ends_with(.value, "docusign.net")
      )
  )
  and strings.contains(sender.display_name, "via")
)
// negate docusign originated emails
and not any(headers.hops,
            regex.imatch(.received.server.raw, ".+.docusign.(net|com)")
)

// negate replies to docusign notifications
and not any(headers.references, strings.iends_with(., '@camail.docusign.net'))

Detection logic

Scope: inbound message.

Detects DocuSign phishing messages with no DocuSign links, a DocuSign logo or verbage within an image or PDF attachment, from an untrusted sender.

  1. inbound message
  2. any of:
    • all of:
      • all of:
        • length(attachments) > 0
        • length(attachments) ≤ 8
      • length(filter(attachments, .file_type in $file_types_images)) > 0
    • all of:
      • length(attachments) > 0
      • all of attachments where any holds:
        • .file_type in $file_types_images
        • .file_type is 'pdf'
        • any of:
          • .file_extension is 'ics'
          • .content_type in ('text/calendar', 'application/ics')
  3. any of:
    • all of:
      • length(body.links) is not 0
      • any of body.links where:
        • not:
          • .href_url.domain.root_domain matches 'docusign.*'
    • length(body.links) is 0
  4. any of:
    • any of filter(attachments) where all hold:
      • any of:
        • any of ml.logo_detect(.).brands where:
          • .name is 'DocuSign'
        • any of file.explode(.) where all hold:
          • .scan.ocr.raw matches '*DocuSign*'
          • any of:
            • any of ml.nlu_classifier(.scan.ocr.raw).intents where all hold:
              • .name is 'cred_theft'
              • .confidence is not 'low'
            • all of:
              • .scan.ocr.raw matches any of 5 patterns
                • ((re)?view|access|complete(d)?) document(s)?
                • [^d][^o][^cd][^ue]sign(?:\b|ature)
                • important edocs
                • Dokument (überprüfen|prüfen|unterschreiben|geschickt)
                • (wichtig|dringend|sofort)
              • any of ml.nlu_classifier(.scan.ocr.raw).topics where:
                • .name is 'E-Signature'
              • not:
                • strings.count(.scan.ocr.raw, '\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n') > 3
      • not:
        • any of file.explode(.) where any holds:
          • .scan.ocr.raw matches any of 5 patterns
            • *DocuSigned By*
            • *DocuSign Envelope ID*
            • *Certificate Of Completion*
            • *Adobe Sign*
            • *Powered by\nAdobe\nAcrobat Sign*
          • all of:
            • .depth is 0
            • any of:
              • all of:
                • .scan.exiftool.page_count > 10
                • length(.scan.strings.strings) > 8000
              • all of:
                • .scan.exiftool.producer is 'Acrobat Sign'
                • any of .scan.exiftool.fields where all hold:
                  • .key is 'SigningReason'
                  • .value is 'Certified by Adobe Acrobat Sign'
          • all of:
            • any of ml.nlu_classifier(body.current_thread.text).topics where all hold:
              • .name is 'Professional and Career Development'
              • .confidence is 'high'
            • any of ml.nlu_classifier(.scan.ocr.raw).intents where all hold:
              • .name is 'benign'
              • .confidence is not 'low'
    • all of:
      • any of attachments where any holds:
        • .file_type is 'gif'
        • any of beta.parse_exif(.).fields where all hold:
          • .key is 'Warning'
          • .value is 'Truncated PNG image'
      • any of:
        • any of ml.logo_detect(file.message_screenshot()).brands where:
          • .name is 'DocuSign'
        • beta.ocr(file.message_screenshot()).text matches '*DocuSign*'
      • any of:
        • any of ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).intents where all hold:
          • .name is 'cred_theft'
          • .confidence is not 'low'
        • beta.ocr(file.message_screenshot()).text matches any of 5 patterns
          • ((re)?view|access|complete(d)?) document(s)?
          • [^d][^o][^c][^u]sign
          • important edocs
          • Dokument (überprüfen|prüfen|unterschreiben|geschickt)
          • (wichtig|dringend|sofort)
      • not:
        • beta.ocr(file.message_screenshot()).text matches any of 4 patterns
          • *DocuSigned By*
          • *DocuSign Envelope ID*
          • *Certificate Of Completion*
          • *Adobe Sign*
  5. any of:
    • not:
      • profile.by_sender_email().solicited
    • profile.by_sender_email().prevalence is 'new'
    • all of:
      • profile.by_sender_email().any_messages_malicious_or_spam
      • not:
        • profile.by_sender_email().any_messages_benign
  6. not:
    • profile.by_sender_email().any_messages_benign
  7. not:
    • all of:
      • any of headers.hops where:
        • any of .fields where all hold:
          • .name is 'X-Api-Host'
          • .value ends with 'docusign.net'
      • sender.display_name contains 'via'
  8. not:
    • any of headers.hops where:
      • .received.server.raw matches '.+.docusign.(net|com)'
  9. not:
    • any of headers.references where:
      • . ends with '@camail.docusign.net'

Inspects: attachments[].content_type, attachments[].file_extension, attachments[].file_type, body.current_thread.text, body.links, body.links[].href_url.domain.root_domain, headers.hops, headers.hops[].fields, headers.hops[].fields[].name, headers.hops[].fields[].value, headers.hops[].received.server.raw, headers.references, sender.display_name, type.inbound. Sensors: beta.ocr, beta.parse_exif, file.explode, file.message_screenshot, ml.logo_detect, ml.nlu_classifier, profile.by_sender_email, regex.icontains, regex.imatch, strings.contains, strings.count, strings.ends_with, strings.iends_with, strings.ilike. Reference lists: $file_types_images.

Indicators matched (36)

FieldMatchValue
attachments[].file_typeequalspdf
attachments[].file_extensionequalsics
attachments[].content_typemembertext/calendar
attachments[].content_typememberapplication/ics
strings.ilikesubstringdocusign.*
ml.logo_detect(filter(attachments)[]).brands[].nameequalsDocuSign
strings.ilikesubstring*DocuSign*
ml.nlu_classifier(file.explode(filter(attachments)[])[].scan.ocr.raw).intents[].nameequalscred_theft
regex.icontainsregex((re)?view|access|complete(d)?) document(s)?
regex.icontainsregex[^d][^o][^cd][^ue]sign(?:\b|ature)
regex.icontainsregeximportant edocs
regex.icontainsregexDokument (überprüfen|prüfen|unterschreiben|geschickt)
24 more
regex.icontainsregex(wichtig|dringend|sofort)
ml.nlu_classifier(file.explode(filter(attachments)[])[].scan.ocr.raw).topics[].nameequalsE-Signature
strings.ilikesubstring*DocuSigned By*
strings.ilikesubstring*DocuSign Envelope ID*
strings.ilikesubstring*Certificate Of Completion*
strings.ilikesubstring*Adobe Sign*
strings.ilikesubstring*Powered by\nAdobe\nAcrobat Sign*
file.explode(filter(attachments)[])[].scan.exiftool.producerequalsAcrobat Sign
file.explode(filter(attachments)[])[].scan.exiftool.fields[].keyequalsSigningReason
file.explode(filter(attachments)[])[].scan.exiftool.fields[].valueequalsCertified by Adobe Acrobat Sign
ml.nlu_classifier(body.current_thread.text).topics[].nameequalsProfessional and Career Development
ml.nlu_classifier(body.current_thread.text).topics[].confidenceequalshigh
ml.nlu_classifier(file.explode(filter(attachments)[])[].scan.ocr.raw).intents[].nameequalsbenign
attachments[].file_typeequalsgif
beta.parse_exif(attachments[]).fields[].keyequalsWarning
beta.parse_exif(attachments[]).fields[].valueequalsTruncated PNG image
ml.logo_detect(file.message_screenshot()).brands[].nameequalsDocuSign
ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).intents[].nameequalscred_theft
regex.icontainsregex[^d][^o][^c][^u]sign
headers.hops[].fields[].nameequalsX-Api-Host
strings.ends_withsuffixdocusign.net
strings.containssubstringvia
regex.imatchregex.+.docusign.(net|com)
strings.iends_withsuffix@camail.docusign.net