Skip to content

Commit b8559a3

Browse files
[PR #3317] added rule: Attachment: ICS calendar with embedded file from internal sender with SPF failure
1 parent a0870ef commit b8559a3

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: "Attachment: ICS calendar with embedded file from internal sender with SPF failure"
2+
description: "Detects calendar invitations (ICS files) from internal domains that fail SPF authentication and contain embedded attachments, with single attendee and organizer both from organizational domains."
3+
type: "rule"
4+
severity: "high"
5+
source: |
6+
type.inbound
7+
and sender.email.domain.domain in $org_domains
8+
and not coalesce(headers.auth_summary.spf.pass, false)
9+
// has an ICS file
10+
and any(attachments,
11+
.file_extension == "ics" or .content_type == "text/calendar"
12+
)
13+
// and a single other attachment that isn't an ICS but is embedded in the ICS
14+
and length(filter(attachments,
15+
not (
16+
.file_extension == "ics" or .content_type == "text/calendar"
17+
)
18+
and any(filter(attachments,
19+
.file_extension == "ics"
20+
or .content_type == "text/calendar"
21+
),
22+
strings.contains(file.parse_text(.).text,
23+
..content_id
24+
)
25+
)
26+
)
27+
) == 1
28+
// exlode the ics file and look at the VEVENT file
29+
and any(filter(attachments,
30+
.file_extension == "ics" or .content_type == "text/calendar"
31+
),
32+
any(file.explode(.),
33+
// attendees and org are both within org_domains
34+
any(.scan.ics.calendars,
35+
any(.components,
36+
.type == "VEVENT"
37+
and length(.attendees) == 1
38+
and all(.attendees,
39+
.mailbox.email.domain.domain in $org_domains
40+
)
41+
and any(.organizers,
42+
.mailbox.email.domain.domain in $org_domains
43+
)
44+
and length(.attachments) > 0
45+
)
46+
)
47+
)
48+
)
49+
50+
attack_types:
51+
- "Credential Phishing"
52+
tactics_and_techniques:
53+
- "Spoofing"
54+
- "Evasion"
55+
detection_methods:
56+
- "File analysis"
57+
- "Header analysis"
58+
- "Sender analysis"
59+
id: "5471e221-b1c4-575c-b8e9-8e689bddbf6f"
60+
og_id: "d9ce9db8-0030-50d3-bdd5-aadb97313647"
61+
testing_pr: 3317
62+
testing_sha: 2ca1d2986a531e73f440e23e2316f6001c14ad79

0 commit comments

Comments
 (0)