Skip to content

Commit 4594389

Browse files
[PR #3045] changed rule: Attachment: PDF with recipient email in link
1 parent e24bd3e commit 4594389

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "Attachment: PDF with recipient email in link"
2+
description: "Detects PDF attachments that contain the recipient's domain in the filename and include a single link personalized with the recipient's email address, either in the URL directly, encoded in base64, or within a QR code."
3+
type: "rule"
4+
severity: "high"
5+
source: |
6+
type.inbound
7+
// a single recipient (this is in the link so there can be only one)
8+
and length(recipients.to) == 1
9+
and all(recipients.to, .email.domain.valid)
10+
// a single PDF attachment
11+
and length(filter(attachments, .file_type == "pdf")) == 1
12+
// in the PDF attachment
13+
and any(attachments,
14+
.file_type == "pdf"
15+
and all(recipients.to,
16+
strings.icontains(..file_name, .email.domain.sld)
17+
// now file.explode the attachment and look for the eamil address in links
18+
and any(file.explode(..),
19+
// there is only a single link
20+
length(
21+
filter(.scan.url.urls,
22+
not strings.icontains(.url, 'mailto')
23+
)
24+
) == 1
25+
// that link contains the email address
26+
and (
27+
any(
28+
// filter out mailto links
29+
filter(.scan.url.urls,
30+
not strings.icontains(.url, 'mailto')
31+
),
32+
// in the URL
33+
strings.icontains(.url, ...email.email)
34+
or any(beta.scan_base64(.url,
35+
format="url",
36+
ignore_padding=true
37+
),
38+
strings.icontains(., ..url)
39+
)
40+
)
41+
// or in a QR code
42+
or strings.icontains(.scan.qr.url.url, ..email.email)
43+
or any(beta.scan_base64(.scan.qr.url.url,
44+
format="url",
45+
ignore_padding=true
46+
),
47+
strings.icontains(., ...email.email)
48+
)
49+
)
50+
)
51+
)
52+
)
53+
54+
55+
attack_types:
56+
- "Credential Phishing"
57+
tactics_and_techniques:
58+
- "PDF"
59+
- "QR code"
60+
- "Encryption"
61+
- "Social engineering"
62+
detection_methods:
63+
- "File analysis"
64+
- "QR code analysis"
65+
- "URL analysis"
66+
id: "85e34251-5b91-5871-9f67-63e326c76985"
67+
og_id: "0399d08f-57c6-58cb-87dc-8e58ccd0bc1b"
68+
testing_pr: 3045
69+
testing_sha: 33cb4b2f349cc1015d87c89830a7eb5a52781731

0 commit comments

Comments
 (0)