1+ name : " VIP impersonation with w2 request with reply-to mismatch"
2+ description : " This rule detects emails attempting to impersonate a VIP requesting a W-2 with a reply-to mismatch."
3+ type : " rule"
4+ severity : " high"
5+ source : |
6+ type.inbound
7+ and (
8+ any($org_vips,
9+ strings.contains(sender.display_name, .display_name)
10+ or strings.contains(sender.display_name,
11+ strings.concat(.first_name, " ", .last_name)
12+ )
13+ or strings.contains(sender.display_name,
14+ strings.concat(.last_name, ", ", .first_name)
15+ )
16+ )
17+ or any(regex.extract(sender.display_name, '^(?<first>\S+)\s+(?<second>\S+)$'),
18+ any($org_vips,
19+ strings.contains(.display_name, ..named_groups["first"])
20+ and strings.contains(.display_name, ..named_groups["second"])
21+ )
22+ )
23+ )
24+ and not (
25+ sender.email.domain.domain in $org_domains
26+ and coalesce(headers.auth_summary.dmarc.pass, false)
27+ )
28+
29+ // W-2 Language with a request
30+ and (
31+ strings.contains(strings.replace_confusables(subject.base), 'W-2')
32+ or strings.icontains(subject.base, 'w2')
33+ or strings.icontains(subject.base, 'wage')
34+ or strings.icontains(subject.base, 'tax form')
35+ or strings.icontains(subject.base, 'irs')
36+ )
37+ and strings.contains(body.current_thread.text, 'W-2')
38+ and any(ml.nlu_classifier(body.current_thread.text).entities,
39+ .name == "request"
40+ )
41+
42+ // different reply-to address
43+ and length(headers.reply_to) > 0
44+ and sender.email.email not in map(headers.reply_to, .email.email)
45+
46+ // negate highly trusted sender domains unless they fail DMARC authentication
47+ and not (
48+ sender.email.domain.root_domain in $high_trust_sender_root_domains
49+ and coalesce(headers.auth_summary.dmarc.pass, false)
50+ )
51+ attack_types :
52+ - " BEC/Fraud"
53+ tactics_and_techniques :
54+ - " Impersonation: VIP"
55+ detection_methods :
56+ - " Content analysis"
57+ - " Header analysis"
58+ - " Natural Language Understanding"
59+ id : " 49b212a6-2fa1-5f27-b18e-75126c6b337c"
60+ og_id : " e7e73fad-6ce6-51f9-9b52-40eaef71f5a1"
61+ testing_pr : 4513
62+ testing_sha : 90a3176084fd25d367a7582d78b2cd7bb9c4b8b5
0 commit comments