Credential phishing: Generic document sharing

Detects credential phishing attempts using generic document sharing language where the sender claims to have sent a document for review, but the link doesn't point to legitimate file sharing services.

Sublime rule (View on GitHub)

  1name: "Credential phishing: Generic document sharing"
  2description: |
  3  Detects credential phishing attempts using generic document sharing language
  4  where the sender claims to have sent a document for review, but the link
  5  doesn't point to legitimate file sharing services.  
  6type: "rule"
  7severity: "medium"
  8source: |
  9  type.inbound
 10  // exclude if it's a reply to an existing conversation
 11  and not length(body.previous_threads) > 0
 12  and (
 13    // subject contains document sharing language
 14    regex.icontains(subject.base,
 15                    '\b(has\s+sent\s+you|sent\s+you|shared\s+with\s+you|document\s+to\s+review|document\s*(number|num|#)|file\s+to\s+review|proposal\s+document|new\s+document|document\s+.{0,20}(assigned|available)|(complete|review|shared?).{0,20}agreement.{0,20}|document\s+(?:transfer|shared))\b'
 16    )
 17    or strings.icontains(subject.subject, 'document to review')
 18    or strings.icontains(subject.subject, 'file to review')
 19    or strings.icontains(subject.subject, 'sent you')
 20    or strings.icontains(subject.subject, 'eDocuments Notification')
 21    // or recipient's SLD is the subject
 22    or (
 23      subject.base == sender.email.domain.sld
 24      // account for near-matches
 25      or (
 26        length(subject.base) < length(sender.email.domain.sld)
 27        and any([subject.base], strings.icontains(sender.email.domain.sld, .))
 28      )
 29    )
 30    // blank subject with recipient SLD in message body
 31    or (
 32      (length(subject.base) == 0 or subject.base is null)
 33      and any(recipients.to,
 34              strings.istarts_with(body.current_thread.text, .email.domain.sld)
 35      )
 36    )
 37  )
 38  and (
 39    // body contains document sharing language
 40    regex.icontains(body.current_thread.text,
 41                    '\b(?:document\s+I\s+sent|proposal\s+document|(?:proposal|documents?)\s+for\s+your\s+(?:approval|consideration|review|signature)|see\s+the\s+below|document.*(?:review|posted)|file.*review|let\s+me\s+know\s+what\s+you\s+think|shared.{0,50}document)\b'
 42    )
 43    or strings.icontains(body.current_thread.text, 'document I sent')
 44    or strings.icontains(body.current_thread.text, 'proposal document')
 45    or strings.icontains(body.current_thread.text, 'let me know what you think')
 46    // account for image-as-content
 47    or (
 48      length(body.current_thread.text) < 10
 49      and (
 50        regex.icontains(beta.ocr(file.message_screenshot()).text,
 51                        '\b(document\s+I\s+sent|proposal\s+document|see\s+the\s+below|document.*review|file.*review|let\s+me\s+know\s+what\s+you\s+think|shared.{0,50}document)\b'
 52        )
 53        or strings.icontains(beta.ocr(file.message_screenshot()).text,
 54                             'document I sent'
 55        )
 56        or strings.icontains(beta.ocr(file.message_screenshot()).text,
 57                             'proposal document'
 58        )
 59        or strings.icontains(beta.ocr(file.message_screenshot()).text,
 60                             'let me know what you think'
 61        )
 62      )
 63    )
 64  )
 65  // has links that look like file attachments but aren't
 66  and any(filter(body.links,
 67                 // display text looks like a file
 68                 (
 69                   regex.icontains(.display_text,
 70                                   '\.(pdf|doc|docx|goto|xls|xlsx|ppt|pptx)'
 71                   )
 72                   or regex.icontains(.display_text, '\d+kb|\d+mb')
 73                   or strings.icontains(.display_text, 'document')
 74                   or strings.icontains(.display_text, 'proposal')
 75                   or strings.icontains(.display_text, 'review')
 76                   // account for image-as-content
 77                   or (
 78                     length(body.current_thread.text) < 10
 79                     and length(body.links) == 1
 80                   )
 81                 )
 82                 // but the URL doesn't point to legitimate file sharing
 83                 and .href_url.domain.root_domain not in (
 84                   "sharepoint.com",
 85                   "google.com",
 86                   "dropbox.com",
 87                   "box.com",
 88                   "onedrive.com",
 89                   "1drv.ms",
 90                   "aka.ms",
 91                   "microsoft.com",
 92                   "office.com",
 93                   "docusign.com",
 94                   "adobesign.com",
 95                   "hellosign.com",
 96                   "signable.app"
 97                 )
 98                 and .href_url.domain.domain not in ("drive.google.com")
 99          ),
100          // and points to suspicious domains
101          .href_url.domain.tld in $suspicious_tlds
102          or .href_url.domain.root_domain in $url_shorteners
103          or .href_url.domain.domain in $url_shorteners
104          or .href_url.domain.root_domain in $free_file_hosts
105          or .href_url.domain.domain in $free_file_hosts
106          // or it's a forms/survey platform being abused in self_service_creation_platform_domains
107          or .href_url.domain.root_domain in $self_service_creation_platform_domains
108          or .href_url.domain.domain in $self_service_creation_platform_domains
109          // bulk mailer abuse has been observed
110          or (
111            (
112              .href_url.domain.root_domain in $bulk_mailer_url_root_domains
113              or (
114                .href_url.rewrite.original is not null
115                and 'mandrill' in .href_url.rewrite.encoders
116              )
117            )
118            and .href_url.domain.sld not in $org_slds
119          )
120          // or the page redirects to common website, observed when evasion happens
121          or (
122            length(ml.link_analysis(., mode="aggressive").redirect_history) > 0
123            and ml.link_analysis(., mode="aggressive").effective_url.domain.root_domain in $tranco_10k
124          )
125          // or common email marketing/tracking patterns
126          or regex.match(.href_url.url, 'url\d+\..*\.com/ls/click')
127          or regex.match(.href_url.path, '/ls/click|/click|/c/')
128  )
129  // negate highly trusted sender domains unless they fail DMARC authentication
130  and (
131    (
132      sender.email.domain.root_domain in $high_trust_sender_root_domains
133      and not headers.auth_summary.dmarc.pass
134    )
135    or sender.email.domain.root_domain not in $high_trust_sender_root_domains
136  )
137  and (
138    profile.by_sender().solicited == false
139    or profile.by_sender_email().prevalence == "new"
140    or profile.by_sender_email().days_since.last_contact > 30
141    or (
142      profile.by_sender().any_messages_malicious_or_spam
143      and not profile.by_sender().any_messages_benign
144    )
145    // or it's a spoof of the org_domain
146    or (
147      sender.email.domain.domain in $org_domains
148      and not (
149        headers.auth_summary.spf.pass
150        or coalesce(headers.auth_summary.dmarc.pass, false)
151      )
152    )
153  )
154  and not profile.by_sender().any_messages_benign  
155attack_types:
156  - "Credential Phishing"
157  - "BEC/Fraud"
158tactics_and_techniques:
159  - "Social engineering"
160  - "Evasion"
161  - "Impersonation: Employee"
162detection_methods:
163  - "Content analysis"
164  - "Natural Language Understanding"
165  - "URL analysis"
166  - "Sender analysis"
167id: "9f0e1d2c-3b4a-5c6d-7e8f-9a0b1c2d3e4f"
to-top