Credential phishing: Suspicious e-sign agreement document notification
Detects phishing attempts disguised as e-signature requests, characterized by common document sharing phrases, unusual HTML padding, and suspicious link text.
Sublime rule (View on GitHub)
1name: "Credential phishing: Suspicious e-sign agreement document notification"
2description: "Detects phishing attempts disguised as e-signature requests, characterized by common document sharing phrases, unusual HTML padding, and suspicious link text."
3type: "rule"
4severity: "medium"
5source: |
6 type.inbound
7 and (
8 any([subject.subject, sender.display_name],
9 regex.icontains(strings.replace_confusables(.),
10 "D[0o]cuLink",
11 "Agreement",
12 "Access.&.Appr[0o]ved",
13 "Agreement.{0,5}Review",
14 "Attend.and.Review",
15 "action.re?quired",
16 "AuthentiSign",
17 "Completed.File",
18 "D[0o]chsared",
19 "D[0o]cshared",
20 "D[0o]csPoint",
21 "D[0o]cument.Shared",
22 "D[0o]cuCentre",
23 "D[0o]cuCenter",
24 "D[0o]cCenter",
25 "D[0o]csOnline",
26 "D[0o]cSend",
27 "D[0o]cu?Send",
28 "d[0o]csign",
29 "D[0o]cu-eSin",
30 "D[0o]cu-management",
31 "\\beSign",
32 "e\\.sign",
33 "esign.[0o]nline",
34 "[SsZz][lL][GgSs][Nn].*D[0o]c",
35 "e-d[0o]c",
36 "e-signature",
37 "e-Verify Doc",
38 "eSignature",
39 "eSign&Return",
40 "eSign[0o]nline",
41 "Fileshare",
42 "Review.and.C[0o]mplete",
43 "Review.&.Sign",
44 "Sign[0o]nline",
45 "Signature.Request",
46 "Shared.C[0o]mpleted",
47 "Sign.and.Seal",
48 "viaSign",
49 "D[0o]cuSign",
50 "D[0o]csID",
51 "Complete.{0,10}D[0o]cuSign",
52 "Enroll & Sign",
53 "Review and Sign",
54 "Sign(?:Report|Now)",
55 "SignD[0o]c",
56 "D[0o]cxxx",
57 "d[0o]cufile",
58 'E\x{00AD}-\x{00AD}S\x{00AD}i\x{00AD}g\x{00AD}n\x{00AD}&Return',
59 "d[0o]cument.signature",
60 "Electr[0o]nic.?Signature",
61 "Complete: ",
62 "Please (?:Review|Sign)",
63 "^REVIEW$",
64 "requests your signature",
65 "signature on.*contract",
66 "Independent Contract",
67 "Contract.*signature",
68 "add your signature",
69 "signature needed",
70 "attn_task",
71 "DocReq\\b",
72 "noreply_edocx-task[0-9a-f-]{36}",
73 "securesign delivery",
74 "kindly review",
75 "^i shared.*with you",
76 'e?doc\sreceived?'
77 )
78 or (
79 regex.icontains(strings.replace_confusables(.), "action.re?quired")
80 and not (
81 sender.email.domain.root_domain == "sharepointonline.com"
82 and headers.auth_summary.dmarc.pass
83 and strings.icontains(subject.subject, "asked to edit")
84 )
85 )
86 )
87 // lure CTA injected into the body (not subject/display) above a forwarded thread
88 or (
89 regex.icontains(strings.replace_confusables(body.current_thread.text),
90 "requests? your signature",
91 "review, sign, and return",
92 "signature on the attached",
93 "sign for execution",
94 "your esignature"
95 )
96 // legit "please sign & return" mail attaches the actual document; this
97 // campaign references an "attached" doc but delivers a fake one via an
98 // off-domain link, with no real document attached
99 and not any(attachments,
100 .file_extension in~ ("pdf", "doc", "docx", "xls", "xlsx", "rtf")
101 )
102 // legit notification platforms (e.g. ParentSquare, Panopto) self-host their
103 // "review/sign/view" CTA on the sender's own root domain; this campaign points
104 // the CTA at an off-domain credential page. require a suspicious link whose
105 // display text is a document CTA AND that leaves the sender domain, so
106 // self-hosted legit notifications (and incidental links like the aka.ms
107 // first-contact banner, which carries no CTA verb) don't match.
108 and any(body.links,
109 .href_url.domain.root_domain is not null
110 and .href_url.domain.root_domain != sender.email.domain.root_domain
111 and regex.icontains(strings.replace_confusables(.display_text),
112 "view",
113 "review",
114 "sign",
115 "document",
116 "download",
117 "open",
118 "complete"
119 )
120 )
121 )
122 )
123 and (
124 // unusual repeated patterns in HTML
125 regex.icontains(body.html.raw, '((<br\s*/?>\s*){20,}|\n{20,})')
126 or regex.icontains(body.html.raw, '(<p[^>]*>\s*<br\s*/?>\s*</p>\s*){30,}')
127 or regex.icontains(body.html.raw,
128 '(<p class=".*?"><span style=".*?"><o:p> </o:p></span></p>\s*){30,}'
129 )
130 or regex.icontains(body.html.raw, '(<p> </p>\s*){7,}')
131 or regex.icontains(body.html.raw, '(<p[^>]*>\s* <br>\s*</p>\s*){5,}')
132 or regex.icontains(body.html.raw, '(<p[^>]*> </p>\s*){7,}')
133 or strings.count(body.html.raw, " \u{200C} \u{200C} ") > 50
134 or regex.count(body.html.raw,
135 '<span\s*class\s*=\s*"[^\"]+"\s*>\s*[a-z]\s*<\/span><span\s*class\s*=\s*"[^\"]+"\s*>\s*[a-z]+\s*<\/span>'
136 ) > 50
137 // lookalike docusign
138 or regex.icontains(body.html.raw, '>Docus[1l]gn<')
139 or strings.icontains(body.current_thread.text, 'completed by all parties')
140 or (
141 regex.icontains(body.html.inner_text, 'Document')
142 and length(body.html.inner_text) < 500
143 )
144 // common greetings via email.local_part
145 or any(recipients.to,
146 // use count to ensure the email address is not part of a disclaimer
147 strings.icount(body.current_thread.text, .email.local_part) >
148 // sum allows us to add more logic as needed
149 sum([
150 strings.icount(body.current_thread.text,
151 strings.concat('was sent to ', .email.email)
152 ),
153 strings.icount(body.current_thread.text,
154 strings.concat('intended for ', .email.email)
155 )
156 ]
157 )
158 )
159 // common greetings via mailbox display name
160 or strings.icount(body.current_thread.text, mailbox.display_name) >
161 // sum allows us to add more logic as needed
162 sum([
163 strings.icount(body.current_thread.text,
164 strings.concat('was sent to ', mailbox.display_name)
165 ),
166 strings.icount(body.current_thread.text,
167 strings.concat('intended for ', mailbox.display_name)
168 )
169 ]
170 )
171 // Abnormally high count of mailto links in raw html
172 or regex.count(body.html.raw,
173 'mailto:[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}'
174 ) > 50
175
176 // High count of empty elements (padding)
177 or regex.count(body.html.raw,
178 '<(?:p|div|span|td)[^>]*>\s*(?: |\s)*\s*</(?:p|div|span|td)>'
179 ) > 30
180
181 // HR impersonation
182 or strings.ilike(sender.display_name, "HR", "H?R", "*Human Resources*")
183
184 // Sender display name contains a phone number
185 or regex.icontains(sender.display_name,
186 '\+?([ilo0-9]{1}.)?\(?[ilo0-9]{3}?\)?.[ilo0-9]{3}.?[ilo0-9]{4}'
187 )
188
189 // short CTA grafted above a forwarded legitimate thread to borrow its credibility
190 or (
191 length(body.previous_threads) > 0 and length(body.current_thread.text) < 600
192 )
193 or (
194 1 < length(body.current_thread.links) < 5
195 and any(body.current_thread.links,
196 any(.href_url.query_params_decoded['url'],
197 strings.parse_url(.).domain.root_domain != ..href_url.domain.root_domain
198 )
199 )
200 )
201 )
202 and (
203 any(body.links,
204
205 // suspicious content within link display_text
206 regex.icontains(strings.replace_confusables(.display_text),
207 "activate",
208 "re-auth",
209 "verify",
210 "acknowledg",
211 "(keep|change).{0,20}(active|password|access)",
212 '((verify|view|click|download|goto|keep|Vιew|release).{0,15}(attachment|current|download|fax|file|document|message|same)s?)',
213 'use.same.pass',
214 'validate.{0,15}account',
215 'recover.{0,15}messages',
216 '(retry|update).{0,10}payment',
217 'check activity',
218 '(listen|play).{0,10}(vm|voice)',
219 'clarify.{0,20}(deposit|wallet|funds)',
220 'enter.{0,15}teams',
221 'Review and sign',
222 'REVIEW.*DOCUMENT',
223 'Open Document',
224 'Sign Now',
225 'complete tasks?',
226 'open docs\b'
227 )
228 // check that the display_text is all lowercase
229 or (
230 regex.contains(.display_text,
231 "\\bVIEW",
232 "DOWNLOAD",
233 "CHECK",
234 "KEEP.(SAME|MY)",
235 "VERIFY",
236 "ACCESS\\b",
237 "SIGN\\b",
238 "ENABLE\\b",
239 "RETAIN",
240 "PLAY",
241 "LISTEN",
242 )
243 and regex.match(.display_text, "^[^a-z]*[A-Z][^a-z]*$")
244 )
245
246 // the display text is _exactly_
247 or .display_text in~ ("Open")
248
249 // URL fragment containing recipient's address
250 or .href_url.fragment in map(recipients.to, .email.email)
251 )
252 // one hyperlinked image that's not a tracking pixel
253 or (
254 length(html.xpath(body.html,
255 "//a//img[(number(@width) > 5 or not(@width)) and (number(@height) > 5 or not(@height))]"
256 ).nodes
257 ) == 1
258 and length(body.current_thread.text) < 500
259 )
260 or (
261 length(attachments) > 0
262 and any(attachments,
263 (
264 regex.icontains(beta.ocr(.).text,
265 "activate",
266 "re-auth",
267 "verify",
268 "acknowledg",
269 "(keep|change).{0,20}(active|password|access)",
270 '((verify|view|click|download|goto|keep|Vιew|release).{0,15}(attachment|current|download|fax|file|document|message|same)s?)',
271 'use.same.pass',
272 'validate.{0,15}account',
273 'recover.{0,15}messages',
274 '(retry|update).{0,10}payment',
275 'check activity',
276 '(listen|play).{0,10}(vm|voice)',
277 'clarify.{0,20}(deposit|wallet|funds)',
278 'enter.{0,15}teams',
279 'Review and sign'
280 )
281 )
282 or (
283 any(file.explode(.),
284 regex.icontains(.scan.ocr.raw,
285 "activate",
286 "re-auth",
287 "verify",
288 "acknowledg",
289 "(keep|change).{0,20}(active|password|access)",
290 '((verify|view|click|download|goto|keep|Vιew|release).{0,15}(attachment|current|download|fax|file|document|message|same)s?)',
291 'use.same.pass',
292 'validate.{0,15}account',
293 'recover.{0,15}messages',
294 '(retry|update).{0,10}payment',
295 'check activity',
296 '(listen|play).{0,10}(vm|voice)',
297 'clarify.{0,20}(deposit|wallet|funds)',
298 'enter.{0,15}teams',
299 'Review and sign'
300 )
301 )
302 )
303 )
304 )
305 )
306 // the message is unsolicited and no false positives
307 and (
308 not profile.by_sender_email().solicited
309 or profile.by_sender_email().prevalence in ("new", "uncommon")
310 or (
311 profile.by_sender_email().any_messages_malicious_or_spam
312 and not profile.by_sender_email().any_messages_benign
313 )
314 or (
315 profile.by_sender_email().any_messages_malicious_or_spam
316 and profile.by_sender_email().any_messages_benign
317 and (
318 not headers.auth_summary.dmarc.pass or not headers.auth_summary.spf.pass
319 )
320 )
321 )
322
323 // negate replies/fowards containing legitimate docs
324 and not (length(headers.references) > 0 or headers.in_reply_to is not null)
325
326 // negate highly trusted sender domains unless they fail DMARC authentication
327 and not (
328 sender.email.domain.root_domain in $high_trust_sender_root_domains
329 and coalesce(headers.auth_summary.dmarc.pass, false)
330 )
331attack_types:
332 - "Credential Phishing"
333tactics_and_techniques:
334 - "Social engineering"
335detection_methods:
336 - "Content analysis"
337 - "Header analysis"
338 - "HTML analysis"
339 - "URL analysis"
340 - "Sender analysis"
341id: "9b68c2d8-951e-5e04-9fa3-2ca67d9226a6"