Employee impersonation: Payroll fraud
This rule detects messages impersonating employees, from unsolicited senders attempting to reroute payroll or alter payment details.
Sublime rule (View on GitHub)
1name: "Employee impersonation: Payroll fraud"
2description: |
3 This rule detects messages impersonating employees, from unsolicited senders attempting to reroute payroll
4 or alter payment details.
5type: "rule"
6severity: "high"
7source: |
8 type.inbound
9 // ensure the display name contains a space to avoid single named process accounts eg. 'billing, payment'
10 and strings.contains(sender.display_name, " ")
11 and (
12 sender.display_name in~ $org_display_names
13 or any($org_display_names, strings.istarts_with(., sender.display_name))
14 or subject.base in~ $org_display_names
15 )
16 and length(attachments) == 0
17 and length(body.links) < 10
18 and (
19 length(body.current_thread.text) < 800
20 or (
21 any(map(filter(ml.nlu_classifier(body.current_thread.text).entities,
22 .name == "disclaimer"
23 ),
24 .text
25 ),
26 (length(body.current_thread.text) - length(.)) < 800
27 )
28 )
29 )
30 and (
31 sender.email.domain.root_domain not in $org_domains
32 or sender.email.domain.root_domain in $free_email_providers
33 )
34 and 1 of (
35 regex.icontains(body.current_thread.text,
36 '(?:p[aá]y\s?(?:ro[lI]{2}|check|date|day)|direct deposit|(?:acct|account) rephrase|paid.{0,50}problems|\bACH\b|\bd\.?d\.?\b|gehalt|salario|salary|employee self[-\s]?service|\bESS\b.{0,30}(?:portal|access|log[-\s]?in)|access.{0,30}(?:HR|employee).{0,30}portal)'
37 ),
38 regex.icontains(subject.subject,
39 '(?:pay\s?(?:roll|check|date|day)|direct deposit|(?:acct|account) rephrase|paid.{0,50}problems|\bACH\b|\bd\.?d\.?\b|gehalt|salario|salary|employee self[-\s]?service|\bESS\b.{0,15}portal)'
40 )
41 )
42
43 // sender profile negations
44 and (
45 not profile.by_sender_email().solicited
46 or profile.by_sender().any_messages_malicious_or_spam
47 )
48 and not profile.by_sender().any_messages_benign
49
50 // negate highly trusted sender domains unless they fail DMARC authentication
51 and not (
52 sender.email.domain.root_domain in $high_trust_sender_root_domains
53 and coalesce(headers.auth_summary.dmarc.pass, false)
54 )
55
56 // negate legitimate conversations
57 and not (
58 (
59 length(headers.references) > 0
60 or headers.in_reply_to is not null
61 or (
62 any(headers.hops,
63 any(.fields,
64 strings.ilike(.name, "x-autoreply")
65 and strings.ilike(.value, "yes")
66 )
67 )
68 )
69 )
70 // previous thread present
71 and (
72 (
73 (subject.is_forward or subject.is_reply)
74 and length(body.previous_threads) >= 1
75 )
76 // automatic reply structure
77 or (
78 strings.istarts_with(subject.base, "automatic reply")
79 or strings.istarts_with(subject.base, "out of office")
80 )
81 )
82 )
83
84 // ignore personal <> work emails
85 and not (
86 length(recipients.to) == 1
87 and sender.email.domain.valid
88 and all(headers.reply_to, .email.email == sender.email.email)
89 and sender.display_name == mailbox.display_name
90 )
91
92 // topic negations
93 and not any(ml.nlu_classifier(body.current_thread.text).topics,
94 .name == "Advertising and Promotions"
95 )
96
97attack_types:
98 - "BEC/Fraud"
99tactics_and_techniques:
100 - "Impersonation: Employee"
101 - "Free email provider"
102 - "Social engineering"
103detection_methods:
104 - "Content analysis"
105 - "Sender analysis"
106id: "2beb7d85-dfe3-5ecc-9b2a-d7416a3ef992"