Brand impersonation: DocuSign branded attachment lure with no DocuSign links

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

Sublime rule (View on GitHub)

  1name: "Brand impersonation: DocuSign branded attachment lure with no DocuSign links"
  2description: "Detects DocuSign phishing messages with no DocuSign links, a DocuSign logo or verbage within an image or PDF attachment, from an untrusted sender."
  3type: "rule"
  4severity: "high"
  5source: |
  6  type.inbound
  7  and (
  8    (
  9      0 < length(attachments) <= 8
 10      and length(filter(attachments, .file_type in $file_types_images)) > 0
 11    )
 12    or (
 13      length(attachments) > 0
 14      and all(attachments,
 15              .file_type in $file_types_images or .file_type == 'pdf'
 16      )
 17    )
 18  )
 19  and (
 20    // if there are links, ensure they are not docusign links
 21    (
 22      length(body.links) != 0
 23      and any(body.links,
 24              not strings.ilike(.href_url.domain.root_domain, "docusign.*")
 25      )
 26    )
 27    // sometimes there are no body links and it's all in the PDF attachment
 28    or length(body.links) == 0
 29  )
 30  and (
 31    // check the image or pdf attachments for Docusign 
 32    any(filter(attachments,
 33               .file_type in $file_types_images or .file_type == 'pdf'
 34        ),
 35        (
 36          any(ml.logo_detect(.).brands, .name == "DocuSign")
 37          or any(file.explode(.),
 38                 strings.ilike(.scan.ocr.raw, "*DocuSign*")
 39                 and (
 40                   any(ml.nlu_classifier(.scan.ocr.raw).intents,
 41                       .name == "cred_theft" and .confidence != "low"
 42                   )
 43                   or (
 44                     regex.icontains(.scan.ocr.raw,
 45                                     "((re)?view|access|complete(d)?) document(s)?",
 46                                     '[^d][^o][^cd][^ue]sign(?:\b|ature)',
 47                                     "important edocs",
 48                                     // German (Document (check|check|sign|sent))
 49                                     "Dokument (überprüfen|prüfen|unterschreiben|geschickt)",
 50                                     // German (important|urgent|immediate)
 51                                     "(wichtig|dringend|sofort)"
 52                     )
 53                     and not strings.count(.scan.ocr.raw, "\n\n\n\n\n\n\n\n\n\n") > 3
 54                   )
 55                 )
 56          )
 57        )
 58        and not any(file.explode(.),
 59                    strings.ilike(.scan.ocr.raw, "*DocuSign Envelope ID*")
 60                    or strings.ilike(.scan.ocr.raw, "*Certificate Of Completion*")
 61                    or (
 62                      .depth == 0
 63                      and .scan.exiftool.page_count > 10
 64                      and length(.scan.strings.strings) > 8000
 65                    )
 66        )
 67    )
 68  
 69    // accomidate truncated pngs and GIF files which can cause logodetect/OCR failures
 70    or (
 71      any(attachments,
 72          (
 73            .file_type =~ "gif"
 74            or any(file.explode(.),
 75                   any(.scan.exiftool.fields,
 76                       .key == "Warning" and .value == "Truncated PNG image"
 77                   )
 78            )
 79          )
 80      )
 81      and (
 82        any(ml.logo_detect(beta.message_screenshot()).brands,
 83            (
 84              .name == "DocuSign"
 85              or any(file.explode(beta.message_screenshot()),
 86                     strings.ilike(.scan.ocr.raw, "*DocuSign*")
 87              )
 88            )
 89        )
 90        and (
 91          any(file.explode(beta.message_screenshot()),
 92              (
 93                any(ml.nlu_classifier(.scan.ocr.raw).intents,
 94                    .name == "cred_theft" and .confidence != "low"
 95                )
 96                or regex.icontains(.scan.ocr.raw,
 97                                   "((re)?view|access|complete(d)?) document(s)?",
 98                                   "[^d][^o][^c][^u]sign",
 99                                   "important edocs",
100                                   // German (Document (check|check|sign|sent))
101                                   "Dokument (überprüfen|prüfen|unterschreiben|geschickt)",
102                                   // German (important|urgent|immediate)
103                                   "(wichtig|dringend|sofort)"
104                )
105              )
106          )
107        )
108        and not any(file.explode(beta.message_screenshot()),
109                    (
110                      strings.ilike(.scan.ocr.raw, "*DocuSigned By*")
111                      and not strings.ilike(.scan.ocr.raw,
112                                            "*DocuSign Envelope ID*"
113                      )
114                      and not strings.ilike(.scan.ocr.raw,
115                                            "*Certificate Of Completion*"
116                      )
117                    )
118        )
119      )
120    )
121  )
122  and (
123    not profile.by_sender().solicited
124    or (
125      profile.by_sender().any_messages_malicious_or_spam
126      and not profile.by_sender().any_false_positives
127    )
128  )
129  and not profile.by_sender().any_false_positives
130  
131  // negate docusign 'via' messages
132  and not (
133    any(headers.hops,
134        any(.fields,
135            .name == "X-Api-Host" and strings.ends_with(.value, "docusign.net")
136        )
137    )
138    and strings.contains(sender.display_name, "via")
139  )
140  
141  // negate docusign originated emails
142  and not any(headers.hops,
143              regex.imatch(.received.server.raw, ".+.docusign.(net|com)")
144  )  
145attack_types:
146  - "Credential Phishing"
147tactics_and_techniques:
148  - "Impersonation: Brand"
149  - "Social engineering"
150detection_methods:
151  - "Computer Vision"
152  - "Content analysis"
153  - "Header analysis"
154  - "Natural Language Understanding"
155  - "Optical Character Recognition"
156  - "Sender analysis"
157  - "URL screenshot"
158id: "814a5694-d626-5bf4-a1ba-a1dbcb625279"
to-top