Skip to content

Commit ff87e35

Browse files
authored
Merge branch 'main' into morriscode-gitgudnoob
2 parents 238d655 + 07d8f92 commit ff87e35

10 files changed

+122
-31
lines changed

.github/workflows/mql-mimic-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737
token: ${{ secrets.GITHUB_TOKEN }}
3838
checkName: "MQL Mimic Tests"
3939
ref: ${{ github.sha }}
40-
timeoutSeconds: 1800
40+
timeoutSeconds: 3600

detection-rules/attachment_macro_dll_loader.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@ severity: "high"
88
source: |
99
type.inbound
1010
and any(attachments,
11-
.file_extension == "zip"
12-
and (
13-
any(file.explode(.),
14-
.scan.zip.encrypted == false
15-
// zip contains a dll file
16-
and any(.scan.zip.all_paths, strings.icontains(., "dll"))
17-
)
18-
and any(file.explode(.),
19-
// macro references a dll file
20-
any(.flavors.yara, strings.like(., "vb_file"))
21-
and any(.scan.strings.strings, strings.icontains(., "dll"))
11+
(
12+
.file_extension == "zip"
13+
and (
14+
any(file.explode(.),
15+
.scan.zip.encrypted == false
16+
// zip contains a dll file
17+
and any(.scan.zip.all_paths, strings.icontains(., "dll"))
18+
)
19+
and any(file.explode(.),
20+
// macro references a dll file
21+
any(.flavors.yara, strings.like(., "vb_file"))
22+
and any(.scan.strings.strings, strings.icontains(., "dll"))
23+
)
2224
)
2325
)
2426
or any(file.explode(.), // fallback for encrypted zips
@@ -27,13 +29,13 @@ source: |
2729
// zip contains a dll file
2830
and any(.scan.zip.all_paths, strings.icontains(., "dll"))
2931
)
30-
or any(attachments,
31-
.file_extension in~ $file_extensions_common_archives
32-
and any(file.explode(.),
33-
any(.flavors.yara, strings.like(., "vb_file"))
34-
and any(.scan.strings.strings, strings.ilike(., "*Lib*.dll*"))
35-
)
36-
and any(file.explode(.), strings.ilike(.file_extension, "dll"))
32+
or (
33+
.file_extension in~ $file_extensions_common_archives
34+
and any(file.explode(.),
35+
any(.flavors.yara, strings.like(., "vb_file"))
36+
and any(.scan.strings.strings, strings.ilike(., "*Lib*.dll*"))
37+
)
38+
and any(file.explode(.), strings.ilike(.file_extension, "dll"))
3739
)
3840
)
3941
attack_types:
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: "Attachment: PDF with link to DMG file download"
2+
description: |
3+
This rule identifies PDF attachments that either link directly to a DMG file, link to a ZIP archive containing a DMG file, or link to an encrypted ZIP containing a DMG file. This technique has been observed delivering MetaStealer Malware.
4+
references:
5+
- "https://thehackernews.com/2023/09/beware-metastealer-malware-targets.html"
6+
- "https://duo.com/decipher/new-metastealer-malware-targets-macos-users"
7+
- "https://www.sentinelone.com/blog/macos-metastealer-new-family-of-obfuscated-go-infostealers-spread-in-targeted-attacks/​"
8+
type: "rule"
9+
severity: "medium"
10+
source: |
11+
type.inbound
12+
and any(attachments,
13+
.file_type == "pdf"
14+
and any(file.explode(.),
15+
any(.scan.url.urls,
16+
17+
// url links to dmg or zip
18+
(
19+
strings.iends_with(.url, ".dmg") or strings.iends_with(.url, "zip")
20+
)
21+
22+
// and downloads a dmg or a zip
23+
and any(beta.linkanalysis(.).files_downloaded,
24+
(
25+
.file_extension == "dmg"
26+
or (
27+
.file_extension in~ $file_extensions_common_archives
28+
29+
// and the zip contains a dmg file
30+
and any(file.explode(.),
31+
(.file_extension =~ "dmg")
32+
33+
// exif inspection if encrypted
34+
or strings.ends_with(.scan.exiftool.zip_file_name, ".dmg")
35+
)
36+
)
37+
)
38+
)
39+
)
40+
)
41+
)
42+
43+
44+
// first time sender
45+
and (
46+
(
47+
sender.email.domain.root_domain in $free_email_providers
48+
and sender.email.email not in $sender_emails
49+
)
50+
or (
51+
sender.email.domain.root_domain not in $free_email_providers
52+
and sender.email.domain.domain not in $sender_domains
53+
)
54+
)
55+
tags:
56+
- "Malfam: MetaStealer"
57+
attack_types:
58+
- "Malware/Ransomware"
59+
tactics_and_techniques:
60+
- "Evasion"
61+
- "PDF"
62+
detection_methods:
63+
- "Archive analysis"
64+
- "Content analysis"
65+
- "File analysis"
66+
- "URL analysis"
67+
68+
id: "2c486fe0-506d-5498-bb19-dbe58904f9dc"

detection-rules/impersonation_amazon.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,15 @@ source: |
2525
and sender.email.domain.root_domain in $free_email_providers
2626
)
2727
)
28+
// negate listservs
29+
and not (
30+
any(headers.hops, any(.fields, .name == "List-Unsubscribe"))
31+
and strings.contains(sender.display_name, "via")
32+
)
2833
and sender.email.domain.root_domain not in~ (
2934
'amazon.com',
3035
'amazon.com.au',
36+
'amazon.com.be',
3137
'amazon.co.uk',
3238
'amazon.de',
3339
'amazon.es',

detection-rules/impersonation_github.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ source: |
1313
or strings.ilike(sender.email.email, '*github*')
1414
or strings.ilevenshtein(sender.email.domain.sld, 'github') <= 1
1515
)
16+
// negating listservs
17+
and not (
18+
any(headers.hops, any(.fields, .name == "List-Unsubscribe"))
19+
and strings.contains(sender.display_name, "via")
20+
)
1621
and sender.email.domain.root_domain not in (
1722
'github.com',
1823
'gitlab.com',

detection-rules/impersonation_microsoft.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,13 @@ source: |
3636
'Microsoft Azure'
3737
)
3838
)
39-
and sender.email.domain.root_domain not in~ ('microsoft.com', 'microsoftsupport.com', 'office.com')
40-
39+
and sender.email.domain.root_domain not in~ (
40+
'microsoft.com',
41+
'microsoftsupport.com',
42+
'office.com',
43+
'teams-events.com'
44+
)
45+
4146
// first-time sender
4247
and (
4348
(
@@ -49,6 +54,7 @@ source: |
4954
and sender.email.domain.domain not in $sender_domains
5055
)
5156
)
57+
5258
attack_types:
5359
- "Credential Phishing"
5460
tactics_and_techniques:

detection-rules/impersonation_venmo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ source: |
1212
or strings.ilevenshtein(sender.display_name, 'venmo') <= 1
1313
or strings.ilike(sender.email.domain.domain, '*venmo*')
1414
)
15-
and sender.email.domain.root_domain not in~ ('venmo.com', 'synchronybank.com', 'venmocreditsurvey.com')
15+
and sender.email.domain.root_domain not in~ ('venmo.com', 'synchronybank.com', 'venmocreditsurvey.com', 'venmo-experience.com')
1616
and sender.email.email not in $recipient_emails
1717
1818
// and not if the sender.display.name contains "via" and dmarc pass from venmo.com

detection-rules/link_credential_phishing_intent_and_other_indicators.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ source: |
279279
// this is common in link tracking, both for
280280
// benign marketing traffic but also attackers
281281
any(recipients.to,
282-
strings.icontains(..href_url.url, .email.local_part)
282+
.email.domain.valid
283+
and strings.icontains(..href_url.url, .email.local_part)
283284
and strings.icontains(..href_url.url, .email.domain.domain)
284285
)
285286
)
@@ -290,12 +291,12 @@ source: |
290291
and (
291292
// freemail providers should never be sending this type of email
292293
sender.email.domain.domain in $free_email_providers
293-
294+
294295
// if not freemail, it's suspicious if the sender's root domain
295296
// doesn't match any links in the body
296297
or all(body.links, .href_url.domain.root_domain != sender.email.domain.root_domain)
297298
)
298-
299+
299300
// first-time sender
300301
and (
301302
(

detection-rules/link_qr_code_suspicious_language_fts.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,22 @@ type: "rule"
77
severity: "medium"
88
source: |
99
type.inbound
10-
10+
1111
// check image attachments for QR code, will want to add message.screenshot functionality here when it's ready
12+
// and length(attachments) < 10
1213
and any(attachments,
13-
.file_type in $file_types_images
14+
(.file_type in $file_types_images or .file_type == "pdf")
1415
and any(file.explode(.),
1516
.scan.qr.type == "url"
16-
17+
1718
// recipient email address is present in the URL, a common tactic used in credential phishing attacks and the url is not in $org_domains
18-
and any(recipients.to, strings.icontains(..scan.qr.data, .email.email))
19+
and any(recipients.to,
20+
strings.icontains(..scan.qr.data, .email.email) and .email.domain.valid
21+
)
1922
and .scan.qr.url.domain.root_domain not in $org_domains
2023
)
2124
)
22-
25+
2326
// NLU has identified cred_theft language with high confidence
2427
and (
2528
any(ml.nlu_classifier(body.current_thread.text).intents,
@@ -40,7 +43,7 @@ source: |
4043
)
4144
)
4245
)
43-
46+
4447
// first-time sender
4548
and (
4649
(

detection-rules/attachment_pdf_file_with_embedded_content.yml renamed to discovery-rules/attachment_pdf_file_with_embedded_content.yml

File renamed without changes.

0 commit comments

Comments
 (0)