Skip to content

Commit b8b74a5

Browse files
[Test Rules] [PR #4600] added rule: Advance Fee Fraud (AFF) from freemail provider or suspicious TLD
1 parent 0693865 commit b8b74a5

1 file changed

Lines changed: 100 additions & 0 deletions

File tree

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: "Advance Fee Fraud (AFF) from freemail provider or suspicious TLD"
2+
description: |
3+
Advance Fee Fraud (AFF) is a type of BEC/Fraud involving upfront fees for promised
4+
future returns, such as lottery scams, inheritance payouts, and investment opportunities.
5+
This rule identifies messages from Freemail domains or suspicious TLDS, including those
6+
with suspicious reply-to addresses. It utilizes Natural Language Understanding to detect
7+
AFF language in their contents.
8+
type: "rule"
9+
severity: "medium"
10+
source: |
11+
type.inbound
12+
and (
13+
sender.email.domain.domain in $free_email_providers
14+
or (
15+
length(headers.reply_to) > 0
16+
and all(headers.reply_to,
17+
(
18+
.email.domain.root_domain in $free_email_providers
19+
or .email.domain.tld in $suspicious_tlds
20+
or (
21+
network.whois(.email.domain).days_old < 365
22+
and length(coalesce(body.html.raw, "")) == 0
23+
)
24+
)
25+
and .email.email != sender.email.email
26+
)
27+
)
28+
or sender.email.domain.tld in $suspicious_tlds
29+
or any(["jp", "jo"], strings.iends_with(sender.email.domain.tld, .))
30+
or (
31+
length(recipients.to) == 0
32+
and any(headers.reply_to,
33+
.email.domain.root_domain != sender.email.domain.root_domain
34+
)
35+
)
36+
)
37+
and (
38+
any(ml.nlu_classifier(body.current_thread.text).intents,
39+
.name == "advance_fee" and .confidence in ("medium", "high")
40+
)
41+
or (
42+
length(body.current_thread.text) < 200
43+
and regex.icontains(body.current_thread.text,
44+
'(?:donation|inheritence|\$\d,\d{3}\,\d{3}|lottery)'
45+
)
46+
and not regex.icontains(body.current_thread.text,
47+
'(?:closed.{0,50})?\$\d,\d{3}\,\d{3}.{0,100}(?:homes|realty|sale)?'
48+
)
49+
and not any(body.links,
50+
regex.icontains(.href_url.url,
51+
'(?:donation|inheritence|\$\d,\d{3}\,\d{3}|lottery)'
52+
)
53+
)
54+
and (
55+
(
56+
(
57+
length(headers.references) > 0
58+
or not any(headers.hops,
59+
any(.fields, strings.ilike(.name, "In-Reply-To"))
60+
)
61+
)
62+
and not (
63+
(
64+
strings.istarts_with(subject.subject, "RE:")
65+
// out of office auto-reply
66+
or strings.istarts_with(subject.subject, "Automatic reply:")
67+
or strings.istarts_with(subject.subject, "R:")
68+
or strings.istarts_with(subject.subject, "ODG:")
69+
or strings.istarts_with(subject.subject, "答复:")
70+
or strings.istarts_with(subject.subject, "AW:")
71+
or strings.istarts_with(subject.subject, "TR:")
72+
or strings.istarts_with(subject.subject, "FWD:")
73+
or regex.icontains(subject.subject,
74+
'^(\[[^\]]+\]\s?){0,3}(re|fwd?)\s?:'
75+
)
76+
)
77+
)
78+
)
79+
or any(headers.reply_to, .email.email != sender.email.email)
80+
)
81+
)
82+
)
83+
and (
84+
not profile.by_sender().solicited
85+
or profile.by_sender().any_messages_malicious_or_spam
86+
)
87+
and not profile.by_sender().any_messages_benign
88+
attack_types:
89+
- "BEC/Fraud"
90+
tactics_and_techniques:
91+
- "Social engineering"
92+
detection_methods:
93+
- "Content analysis"
94+
- "Header analysis"
95+
- "Natural Language Understanding"
96+
- "Sender analysis"
97+
id: "45a54bb2-f718-53c3-a71a-6a34d9d05fd1"
98+
og_id: "6a5af373-a97b-5013-aeec-42ac8b4b8ba1"
99+
testing_pr: 4600
100+
testing_sha: 0a1da5ce0ce595111be2e9da1602ebdecb08d68d

0 commit comments

Comments
 (0)