1+ name : " BEC/Fraud: Job scam fake thread or plaintext pivot to freemail"
2+ description : " Detects potential job scams using plaintext or fake threads attempting to pivot to a freemail address from an unsolicited sender."
3+ type : " rule"
4+ severity : " medium"
5+ source : |
6+ type.inbound
7+ and any(ml.nlu_classifier(body.current_thread.text).entities,
8+ .name in ("greeting", "salutation")
9+ )
10+
11+ // most likely to occur in plain text
12+ and (
13+ body.html.raw is null
14+ or
15+
16+ // HTML is not null but fake thread
17+ (subject.is_reply or subject.is_forward)
18+ and (
19+ (length(headers.references) == 0 and headers.in_reply_to is null)
20+ or not any(headers.hops, any(.fields, strings.ilike(.name, "In-Reply-To")))
21+ )
22+ )
23+ and 3 of (
24+ any([subject.subject, body.current_thread.text],
25+ regex.icontains(., '(full|part).time')
26+ ),
27+ strings.ilike(body.current_thread.text, '*job*'),
28+ regex.icontains(body.current_thread.text, '\bHR\b'),
29+ strings.ilike(body.current_thread.text, '*manager*'),
30+ strings.ilike(body.current_thread.text, '*commission*'),
31+ strings.ilike(body.current_thread.text, '*hourly*'),
32+ strings.ilike(body.current_thread.text, '*prior experience*'),
33+ strings.ilike(body.current_thread.text, '*company rep*'),
34+ strings.ilike(body.current_thread.text, "100% legal")
35+ )
36+
37+ // all attachments are images or there's no attachments
38+ and (
39+ (
40+ length(attachments) > 0
41+ and all(attachments, .file_type in $file_types_images)
42+ )
43+ or length(attachments) == 0
44+ )
45+
46+ // there's an email in the body
47+ and regex.contains(body.current_thread.text,
48+ "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"
49+ )
50+
51+ // and it's likely a freemail
52+ and any($free_email_providers, strings.icontains(body.current_thread.text, .))
53+
54+ // and that email doesn't match the sender domain
55+ and (
56+ all(body.links, .href_url.domain.root_domain != sender.email.domain.domain)
57+ or sender.email.domain.root_domain in $free_email_providers
58+ )
59+ and (
60+ (
61+ not profile.by_sender().solicited
62+ and not profile.by_sender().any_messages_benign
63+ )
64+ or profile.by_sender().any_messages_malicious_or_spam
65+ )
66+ and not profile.by_sender().any_messages_benign
67+
68+ attack_types :
69+ - " BEC/Fraud"
70+ tactics_and_techniques :
71+ - " Free email provider"
72+ - " Out of band pivot"
73+ detection_methods :
74+ - " Content analysis"
75+ - " File analysis"
76+ - " Natural Language Understanding"
77+ id : " a08ce09d-b492-5e4c-84e8-1b4dadb5531c"
78+ og_id : " ce21c151-90c2-5573-b19e-3dcbcfc0a195"
79+ testing_pr : 3470
80+ testing_sha : 29a34151c5996071b29990b56857e3a1cdb712c1
0 commit comments