Free subdomain link with login or captcha (untrusted sender)

Message contains a link that uses a free subdomain provider, and has a login or captcha on the page.

Sublime rule (View on GitHub)

 1name: "Free subdomain link with login or captcha (untrusted sender)"
 2description: |
 3    Message contains a link that uses a free subdomain provider, and has a login or captcha on the page.
 4type: "rule"
 5severity: "medium"
 6source: |
 7  type.inbound
 8  and 0 < length(body.links) < 10
 9  and any(body.links,
10  
11          // contains login or captcha
12          (
13            beta.linkanalysis(.).credphish.contains_login
14            or beta.linkanalysis(.).credphish.contains_captcha
15          )
16  
17          // either the original or the redirect is a free subdomain
18          and (
19            beta.linkanalysis(.).effective_url.domain.root_domain in $free_subdomain_hosts
20            or .href_url.domain.root_domain in $free_subdomain_hosts
21          )
22  
23          // exclude FP prone free subdomain hosts
24          // if it's a known brand impersonation, we'll detect it in other rules
25          and .href_url.domain.root_domain not in ("zendesk.com")
26          and beta.linkanalysis(.).effective_url.domain.root_domain not in ("zendesk.com")
27          and beta.linkanalysis(.).effective_url.domain.domain not in ("login.squarespace.com")
28  )
29  
30  // exclude all freesubdomain links are images
31  and length(filter(body.links, 
32                 .href_url.domain.root_domain in $free_subdomain_hosts
33                 and .href_url.domain.subdomain is not null
34                 and .href_url.domain.subdomain != "www") ) > 0
35  
36  and not all(filter(body.links, 
37                 .href_url.domain.root_domain in $free_subdomain_hosts
38                 and .href_url.domain.subdomain is not null
39                 and .href_url.domain.subdomain != "www"), (strings.ends_with(.href_url.url, "jpeg") or strings.ends_with(.href_url.url, "png")))
40  
41  // exclude FP prone senders
42  and sender.email.domain.root_domain not in ("sharepointonline.com")
43  // negate highly trusted sender domains unless they fail DMARC authentication
44  and (
45    (
46      sender.email.domain.root_domain in $high_trust_sender_root_domains
47      and (
48        any(distinct(headers.hops, .authentication_results.dmarc is not null),
49            strings.ilike(.authentication_results.dmarc, "*fail")
50        )
51      )
52    )
53    or sender.email.domain.root_domain not in $high_trust_sender_root_domains
54  )
55  and (
56    (
57      profile.by_sender().prevalence in ("new", "outlier")
58      and not profile.by_sender().solicited
59    )
60    or (
61      profile.by_sender().any_messages_malicious_or_spam
62      and not profile.by_sender().any_false_positives
63    )
64  )
65  and not profile.by_sender().any_false_positives  
66
67tags:
68  - "Attack surface reduction"
69attack_types:
70  - "Credential Phishing"
71tactics_and_techniques:
72  - "Free subdomain host"
73  - "Social engineering"
74detection_methods:
75  - "Computer Vision"
76  - "File analysis"
77  - "Sender analysis"
78  - "URL screenshot"
79id: "93288f82-fbd2-5e88-b207-7f06386495a6"

Related rules

to-top