Skip to content

Commit 78eac05

Browse files
[Shared Samples] [PR #4586] modified rule: PR# 4586 - BEC: Tax document request
1 parent da7a5c5 commit 78eac05

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

detection-rules/4586_tax_w2_impersonation.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: "PR# 4586 - BEC Impersonation: Tax document request"
1+
name: "PR# 4586 - BEC: Tax document request"
22
description: "Detects messages requesting W-2 tax documents or related tax information that exhibit authentication failures such as DMARC or SPF failures, or mismatched reply-to addresses. The rule identifies senders using common administrative local parts and filters for messages containing W-2 language combined with request entities detected through natural language processing."
33
type: "rule"
44
severity: "medium"
55
source: |
66
type.inbound
7-
// and 150 < length(body.current_thread.text) < 750
7+
and length(body.current_thread.text) < 500
88
and sender.email.local_part in~ (
99
"contact",
1010
"no-reply",
@@ -19,25 +19,27 @@ source: |
1919
2020
// mismatched From and Reply-to
2121
and (
22-
(
23-
length(headers.reply_to) > 0
24-
and all(headers.reply_to,
25-
.email.domain.root_domain != sender.email.domain.root_domain
26-
)
22+
length(headers.reply_to) > 0
23+
and all(headers.reply_to,
24+
.email.domain.root_domain != sender.email.domain.root_domain
2725
)
28-
or not headers.auth_summary.dmarc.pass
29-
or not headers.auth_summary.spf.pass
3026
)
3127
3228
// W-2 Language with a request
3329
and (
34-
strings.contains(strings.replace_confusables(subject.base), 'W-2')
35-
or strings.icontains(subject.base, 'w2')
30+
strings.contains(subject.base, 'W-2')
3631
or strings.icontains(subject.base, 'wage')
3732
or strings.icontains(subject.base, 'tax form')
3833
or strings.icontains(subject.base, 'irs')
34+
or regex.icontains(subject.base, 'w2\b')
35+
)
36+
// body text containing variations of "W2"
37+
and (
38+
strings.icontains(body.current_thread.text, "w2")
39+
or strings.icontains(body.current_thread.text, "W-2")
40+
or strings.icontains(body.current_thread.text, "Ẇ-2's")
41+
or strings.icontains(body.current_thread.text, "wage")
3942
)
40-
and strings.contains(body.current_thread.text, 'W-2')
4143
and any(ml.nlu_classifier(body.current_thread.text).entities,
4244
.name == "request"
4345
)
@@ -49,7 +51,6 @@ source: |
4951
"*OneNote*",
5052
"*Microsoft*"
5153
)
52-
and coalesce(headers.auth_summary.dmarc.pass, false)
5354
)
5455
and not any(ml.nlu_classifier(body.current_thread.text).intents,
5556
.name == "benign" and .confidence == "high"
@@ -62,6 +63,7 @@ source: |
6263
)
6364
6465
66+
6567
attack_types:
6668
- "BEC/Fraud"
6769
tactics_and_techniques:

0 commit comments

Comments
 (0)