Skip to content

Commit 1b2383e

Browse files
[PR #3593] added rule: Evasion: Hidden Unicode characters with suspicious indicators
1 parent 98f3433 commit 1b2383e

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: "Evasion: Hidden Unicode characters with suspicious indicators"
2+
description: "Detects messages containing excessive hidden Unicode characters (invisible text formatting characters) in the subject line, body, or attachments, combined with suspicious patterns such as lengthy recipient lists, financial/security-related keywords, or specific attachment types commonly abused for evasion."
3+
type: "rule"
4+
severity: "medium"
5+
source: |
6+
type.inbound
7+
and not subject.is_reply
8+
and not sender.email.domain.root_domain in ("github.com")
9+
and (
10+
// hidden unicode in subject line
11+
regex.count(subject.subject,
12+
'[\x{E0000}-\x{E007F}\x{FE00}-\x{FE0F}\x{E0100}-\x{E01EF}\x{2062}\x{2064}]'
13+
) > 10
14+
15+
// hidden unicode in body content
16+
or regex.count(body.html.display_text,
17+
'[\x{E0000}-\x{E007F}\x{FE00}-\x{FE0F}\x{E0100}-\x{E01EF}\x{2062}\x{2064}]'
18+
) > 10
19+
or regex.count(body.plain.raw,
20+
'[\x{E0000}-\x{E007F}\x{FE00}-\x{FE0F}\x{E0100}-\x{E01EF}\x{2062}\x{2064}]'
21+
) > 10
22+
23+
// hidden unicode in attachments
24+
or any(attachments,
25+
any(file.explode(.),
26+
// higher count threshold for general files
27+
regex.count(.scan.strings.raw,
28+
'[\x{E0000}-\x{E007F}\x{FE00}-\x{FE0F}\x{E0100}-\x{E01EF}\x{2062}\x{2064}]'
29+
) > 20
30+
31+
// lower threshold for specific file types prone to abuse like ics and pdf
32+
or (
33+
.file_extension in~ (
34+
'ics',
35+
'eml',
36+
'msg',
37+
'txt',
38+
'html',
39+
'htm',
40+
'rtf',
41+
'docx',
42+
'pdf'
43+
)
44+
and regex.icontains(.scan.strings.raw,
45+
'[\x{E0000}-\x{E007F}\x{FE00}-\x{FE0F}\x{E0100}-\x{E01EF}\x{2062}\x{2064}]{6,}'
46+
)
47+
)
48+
)
49+
)
50+
)
51+
and (
52+
// lengthy recipient list
53+
length(recipients.to) > 30
54+
55+
// subject line (assuming we can read it) contains suspicious financial/security terms
56+
or regex.icontains(subject.subject,
57+
'(wallet|account|restrict|suspend|verif|secur|urgent|action.required)'
58+
)
59+
60+
// common evasion patterns in subject
61+
or (
62+
regex.count(subject.subject,
63+
'[\x{E0000}-\x{E007F}\x{FE00}-\x{FE0F}\x{E0100}-\x{E01EF}\x{2062}\x{2064}]'
64+
) > 15
65+
and length(subject.subject) < 100
66+
)
67+
68+
// attachment with suspicious content indicators
69+
or any(attachments,
70+
.content_type in~ (
71+
"message/rfc822",
72+
"application/octet-stream",
73+
"text/calendar"
74+
)
75+
and .size > 5000
76+
)
77+
)
78+
and not any(ml.nlu_classifier(body.current_thread.text).topics,
79+
.name in ("Newsletters and Digests")
80+
)
81+
82+
attack_types:
83+
- "Credential Phishing"
84+
- "BEC/Fraud"
85+
- "Spam"
86+
tactics_and_techniques:
87+
- "Evasion"
88+
detection_methods:
89+
- "Content analysis"
90+
- "File analysis"
91+
- "Header analysis"
92+
id: "34ad43d8-2bc4-5845-973b-d80f41eed48d"
93+
og_id: "497ce83e-de3a-5773-9c30-bbae7ce063da"
94+
testing_pr: 3593
95+
testing_sha: 7fdf0f39e0ef6186bd1643d7b7360ddabee3e29a

0 commit comments

Comments
 (0)