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            ml.link_analysis(.).credphish.contains_login
14            or ml.link_analysis(.).credphish.contains_captcha
15          )
16  
17          // either the original or the redirect is a free subdomain
18          and (
19            ml.link_analysis(.).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 ml.link_analysis(.).effective_url.domain.root_domain not in (
27            "zendesk.com"
28          )
29          and ml.link_analysis(.).effective_url.domain.domain not in (
30            "login.squarespace.com"
31          )
32  )
33  
34  // exclude all freesubdomain links are images
35  and length(filter(body.links,
36                    .href_url.domain.root_domain in $free_subdomain_hosts
37                    and .href_url.domain.subdomain is not null
38                    and .href_url.domain.subdomain != "www"
39             )
40  ) > 0
41  and not all(filter(body.links,
42                     .href_url.domain.root_domain in $free_subdomain_hosts
43                     and .href_url.domain.subdomain is not null
44                     and .href_url.domain.subdomain != "www"
45              ),
46              (
47                strings.ends_with(.href_url.url, "jpeg")
48                or strings.ends_with(.href_url.url, "png")
49              )
50  )
51  
52  // exclude FP prone senders
53  and sender.email.domain.root_domain not in ("sharepointonline.com")
54  // negate highly trusted sender domains unless they fail DMARC authentication
55  and (
56    (
57      sender.email.domain.root_domain in $high_trust_sender_root_domains
58      and not headers.auth_summary.dmarc.pass
59    )
60    or sender.email.domain.root_domain not in $high_trust_sender_root_domains
61  )
62  and (
63    (
64      profile.by_sender().prevalence in ("new", "outlier")
65      and not profile.by_sender().solicited
66    )
67    or (
68      profile.by_sender().any_messages_malicious_or_spam
69      and not profile.by_sender().any_messages_benign
70    )
71  )
72  and not profile.by_sender().any_messages_benign  
73tags:
74  - "Attack surface reduction"
75attack_types:
76  - "Credential Phishing"
77tactics_and_techniques:
78  - "Free subdomain host"
79  - "Social engineering"
80detection_methods:
81  - "Computer Vision"
82  - "File analysis"
83  - "Sender analysis"
84  - "URL screenshot"
85id: "93288f82-fbd2-5e88-b207-7f06386495a6"

Related rules

to-top