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,
 60                                  "*DocuSigned By*",
 61                                  "*DocuSign Envelope ID*",
 62                                  "*Certificate Of Completion*",
 63                                  "*Adobe Sign*"
 64                    )
 65                    or (
 66                      .depth == 0
 67                      and (
 68                        (
 69                          .scan.exiftool.page_count > 10
 70                          and length(.scan.strings.strings) > 8000
 71                        )
 72                        or (
 73                          .scan.exiftool.producer == "Acrobat Sign"
 74                          and any(.scan.exiftool.fields,
 75                                  .key == "SigningReason"
 76                                  and .value == "Certified by Adobe Acrobat Sign"
 77                          )
 78                        )
 79                      )
 80                    )
 81        )
 82    )
 83  
 84    // accomidate truncated pngs and GIF files which can cause logodetect/OCR failures
 85    or (
 86      any(attachments,
 87          (
 88            .file_type =~ "gif"
 89            or any(file.explode(.),
 90                   any(.scan.exiftool.fields,
 91                       .key == "Warning" and .value == "Truncated PNG image"
 92                   )
 93            )
 94          )
 95      )
 96      and (
 97        any(ml.logo_detect(beta.message_screenshot()).brands,
 98            (
 99              .name == "DocuSign"
100              or any(file.explode(beta.message_screenshot()),
101                     strings.ilike(.scan.ocr.raw, "*DocuSign*")
102              )
103            )
104        )
105        and (
106          any(file.explode(beta.message_screenshot()),
107              (
108                any(ml.nlu_classifier(.scan.ocr.raw).intents,
109                    .name == "cred_theft" and .confidence != "low"
110                )
111                or regex.icontains(.scan.ocr.raw,
112                                   "((re)?view|access|complete(d)?) document(s)?",
113                                   "[^d][^o][^c][^u]sign",
114                                   "important edocs",
115                                   // German (Document (check|check|sign|sent))
116                                   "Dokument (überprüfen|prüfen|unterschreiben|geschickt)",
117                                   // German (important|urgent|immediate)
118                                   "(wichtig|dringend|sofort)"
119                )
120              )
121          )
122        )
123        and not any(file.explode(beta.message_screenshot()),
124                    strings.ilike(.scan.ocr.raw,
125                                  "*DocuSigned By*",
126                                  "*DocuSign Envelope ID*",
127                                  "*Certificate Of Completion*",
128                                  "*Adobe Sign*"
129                    )
130        )
131      )
132    )
133  )
134  and (
135    not profile.by_sender_email().solicited
136    or profile.by_sender_email().prevalence == "new"
137    or (
138      profile.by_sender_email().any_messages_malicious_or_spam
139      and not profile.by_sender_email().any_messages_benign
140    )
141  )
142  and not profile.by_sender_email().any_messages_benign
143  
144  // negate docusign 'via' messages
145  and not (
146    any(headers.hops,
147        any(.fields,
148            .name == "X-Api-Host" and strings.ends_with(.value, "docusign.net")
149        )
150    )
151    and strings.contains(sender.display_name, "via")
152  )
153  
154  // negate docusign originated emails
155  and not any(headers.hops,
156              regex.imatch(.received.server.raw, ".+.docusign.(net|com)")
157  )  
158attack_types:
159  - "Credential Phishing"
160tactics_and_techniques:
161  - "Impersonation: Brand"
162  - "Social engineering"
163detection_methods:
164  - "Computer Vision"
165  - "Content analysis"
166  - "Header analysis"
167  - "Natural Language Understanding"
168  - "Optical Character Recognition"
169  - "Sender analysis"
170  - "URL screenshot"
171id: "814a5694-d626-5bf4-a1ba-a1dbcb625279"
to-top