BEC/Fraud: Payroll diversion with with recipient name in transparent background span

Detects inbound, non-reply messages from free email providers that reference payroll, direct deposit, or salary topics and contains a HTML span (transparent background color) embedding the recipient's email username.

Sublime rule (View on GitHub)

 1name: "BEC/Fraud: Payroll diversion with with recipient name in transparent background span"
 2description: "Detects inbound, non-reply messages from free email providers that reference payroll, direct deposit, or salary topics and contains a HTML span (transparent background color) embedding the recipient's email username."
 3type: "rule"
 4severity: "medium"
 5source: |
 6  type.inbound
 7  and not (
 8    (subject.is_reply or subject.is_forward)
 9    and (length(headers.references) > 0 or headers.in_reply_to is not null)
10  )
11  and sender.email.domain.root_domain in $free_email_providers
12  and (
13    length(body.current_thread.text) < 800
14    or (
15      any(map(filter(ml.nlu_classifier(body.current_thread.text).entities,
16                     .name == "disclaimer"
17              ),
18              .text
19          ),
20          (length(body.current_thread.text) - length(.)) < 800
21      )
22    )
23  )
24  and any(html.xpath(body.html,
25                     "//span[contains(@style,'background-color:transparent')]"
26          ).nodes,
27          length(.display_text) > 2
28          and (
29            strings.icontains(recipients.to[0].email.local_part, .display_text)
30            or .display_text =~ mailbox.first_name
31          )
32  )
33  and 1 of (
34    regex.icontains(body.current_thread.text,
35                    '(?:pay\s?(?:roll|check|date|day)|direct deposit|(?:acct|account) rephrase|paid.{0,50}problems|\bACH\b|\bdd\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)'
36    ),
37    regex.icontains(subject.subject,
38                    '(?:pay\s?(?:roll|check|date|day)|direct deposit|(?:acct|account) rephrase|paid.{0,50}problems|\bACH\b|\bdd\b|gehalt|salario|salary|employee self[-\s]?service|\bESS\b.{0,15}portal)'
39    )
40  )  
41attack_types:
42  - "BEC/Fraud"
43tactics_and_techniques:
44  - "Free email provider"
45  - "Evasion"
46  - "Social engineering"
47detection_methods:
48  - "HTML analysis"
49  - "Content analysis"
50  - "Natural Language Understanding"
51  - "Header analysis"
52  - "Sender analysis"
53id: "74daf22c-1ae7-5919-b016-d62fe8ef10a3"
54related_detections:
55  - "impersonation_employee_payroll_fraud.yml"
to-top