Fake thread with suspicious indicators

Fake thread contains suspicious indicators, which can lead to BEC, credential phishing, and other undesirable outcomes.

Sublime rule (View on GitHub)

  1name: "Fake thread with suspicious indicators"
  2description: "Fake thread contains suspicious indicators, which can lead to BEC, credential phishing, and other undesirable outcomes."
  3type: "rule"
  4severity: "medium"
  5source: |
  6  type.inbound
  7  // fake thread check
  8  and (
  9    (
 10      (
 11        strings.istarts_with(subject.subject, "RE:")
 12        or strings.istarts_with(subject.subject, "FW:")
 13        or strings.istarts_with(subject.subject, "FWD:")
 14        or regex.imatch(subject.subject,
 15                        '(\[[^\]]+\]\s?){0,3}(re|fwd?|automat.*)\s?:.*'
 16        )
 17      )
 18    )
 19    // fake thread, but no indication in the subject line
 20    // current_thread pulls the recent thread, but the full body contains the fake "original" email
 21    or (
 22      not (
 23        (
 24          strings.istarts_with(subject.subject, "RE:")
 25          or strings.istarts_with(subject.subject, "R:")
 26          or strings.istarts_with(subject.subject, "ODG:")
 27          or strings.istarts_with(subject.subject, "答复:")
 28          or strings.istarts_with(subject.subject, "AW:")
 29          or strings.istarts_with(subject.subject, "TR:")
 30          or strings.istarts_with(subject.subject, "FWD:")
 31        )
 32      )
 33      and any([body.current_thread.text, body.html.display_text, body.plain.raw],
 34              3 of (
 35                strings.icontains(., "from:"),
 36                strings.icontains(., "to:"),
 37                strings.icontains(., "sent:"),
 38                strings.icontains(., "date:"),
 39                strings.icontains(., "cc:"),
 40                strings.icontains(., "subject:")
 41              )
 42      )
 43      and (
 44        length(body.current_thread.text) + 100 < length(body.html.display_text)
 45      )
 46    )
 47  )
 48
 49  // negating bouncebacks
 50  and not any(attachments,
 51              .content_type in ("message/delivery-status", "message/rfc822")
 52  )
 53  // negating Google Calendar invites
 54  and (
 55    (
 56      headers.return_path.domain.domain is not null
 57      and headers.return_path.domain.domain != 'calendar-server.bounces.google.com'
 58    )
 59    or headers.return_path.domain.domain is null
 60  )
 61  
 62  and (
 63    length(headers.references) == 0 
 64    or headers.in_reply_to is null
 65  )
 66  
 67  // and not solicited
 68  and not profile.by_sender().solicited
 69  and 4 of (
 70    // language attempting to engage
 71    (
 72      any(ml.nlu_classifier(body.current_thread.text).entities,
 73          .name == "request"
 74      )
 75      and any(ml.nlu_classifier(body.current_thread.text).entities,
 76              .name == "financial"
 77      )
 78    ),
 79  
 80    // invoicing language
 81    (
 82      any(ml.nlu_classifier(body.current_thread.text).tags, .name == "invoice")
 83      or any(ml.nlu_classifier(body.current_thread.text).entities,
 84             .text == "invoice"
 85      )
 86    ),
 87  
 88    // urgency request
 89    any(ml.nlu_classifier(body.current_thread.text).entities, .name == "urgency"),
 90  
 91    // cred_theft detection
 92    any(ml.nlu_classifier(body.current_thread.text).intents,
 93        .name == "cred_theft" and .confidence in~ ("medium", "high")
 94    ),
 95  
 96    // commonly abused sender TLD
 97    strings.ilike(sender.email.domain.tld, "*.jp"),
 98  
 99    // headers traverse abused TLD
100    any(headers.domains, strings.ilike(.tld, "*.jp")),
101  
102    // known suspicious pattern in the URL path
103    any(body.links, regex.match(.href_url.path, '\/[a-z]{3}\d[a-z]')),
104  
105    // link display text is in all caps
106    any(body.links, regex.match(.display_text, '[A-Z ]+')),
107  
108    // display name contains an email
109    regex.contains(sender.display_name, '[a-z0-9]+@[a-z]+'),
110  
111    // Sender domain is empty
112    sender.email.domain.domain == "",
113  
114    // sender domain matches no body domains
115    all(body.links,
116        .href_url.domain.root_domain != sender.email.domain.root_domain
117    ),
118  
119    // body contains name of VIP
120    (
121      any($org_vips, strings.icontains(body.html.inner_text, .display_name))
122      or any($org_vips, strings.icontains(body.plain.raw, .display_name))
123    ),
124  
125    // new body domain
126    any(body.links, network.whois(.href_url.domain).days_old < 30),
127  
128    // new sender domain
129    network.whois(sender.email.domain).days_old < 30,
130  
131    // new sender
132    profile.by_sender().days_known < 7,
133  
134    // excessive whitespace
135    (
136      regex.icontains(body.html.raw, '((<br\s*/?>\s*){20,}|\n{20,})')
137      or regex.icontains(body.html.raw, '(<p[^>]*>\s*<br\s*/?>\s*</p>\s*){30,}')
138      or regex.icontains(body.html.raw,
139                         '(<p class=".*?"><span style=".*?"><o:p>&nbsp;</o:p></span></p>\s*){30,}'
140      )
141      or regex.icontains(body.html.raw, '(<p>&nbsp;</p>\s*){7,}')
142      or regex.icontains(body.html.raw, '(<p>&nbsp;</p><br>\s*){7,}')
143      or regex.icontains(body.html.raw, '(<p[^>]*>\s*&nbsp;<br>\s*</p>\s*){5,}')
144      or regex.icontains(body.html.raw, '(<p[^>]*>&nbsp;</p>\s*){7,}')
145    ),
146  
147    // body contains recipient SLD
148    any(recipients.to,
149        strings.icontains(body.current_thread.text, .email.domain.sld)
150    )
151  )
152  
153  // negate highly trusted sender domains unless they fail DMARC authentication
154  and (
155    (
156      sender.email.domain.root_domain in $high_trust_sender_root_domains
157      and not headers.auth_summary.dmarc.pass
158    )
159    or sender.email.domain.root_domain not in $high_trust_sender_root_domains
160  )
161  and not profile.by_sender().any_false_positives  
162
163tags:
164  - "Attack surface reduction"
165attack_types:
166  - "BEC/Fraud"
167  - "Credential Phishing"
168  - "Spam"
169tactics_and_techniques:
170  - "Evasion"
171  - "Social engineering"
172detection_methods:
173  - "Content analysis"
174  - "Header analysis"
175  - "Natural Language Understanding"
176  - "Sender analysis"
177id: "c2e18a57-1f52-544f-bb6d-a578e286cf89"

Related rules

to-top