Skip to content

Commit

Permalink
Adding extension-less Office file snippet (#679)
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenmitchell authored Dec 19, 2023
1 parent e75cdde commit fa11a71
Show file tree
Hide file tree
Showing 15 changed files with 111 additions and 26 deletions.
6 changes: 6 additions & 0 deletions detection-rules/attachment_cve_2023_21716_rtf_fonts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ source: |
.file_extension in~ ("rtf", "doc", "docx")
or .file_extension in~ $file_extensions_common_archives
or .file_extension in~ $file_extensions_macros
or (
.file_extension is null
and .file_type == "unknown"
and .content_type == "application/octet-stream"
and .size < 100000000
)
)
and any(file.explode(.),
any(.scan.strings.strings, strings.ilike(., '*\fonttbl*'))
Expand Down
10 changes: 9 additions & 1 deletion detection-rules/attachment_encrypted_ole_unsolicited.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ severity: "medium"
source: |
type.inbound
and any(attachments,
.file_extension in~ $file_extensions_macros
(
.file_extension in~ $file_extensions_macros
or (
.file_extension is null
and .file_type == "unknown"
and .content_type == "application/octet-stream"
and .size < 100000000
)
)
and file.oletools(.).indicators.encryption.exists
)
and (
Expand Down
6 changes: 6 additions & 0 deletions detection-rules/attachment_office_file_with_vsto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ source: |
(
.file_extension in~ $file_extensions_macros
or .file_extension in~ $file_extensions_common_archives
or (
.file_extension is null
and .file_type == "unknown"
and .content_type == "application/octet-stream"
and .size < 100000000
)
)
and any(file.explode(.),
.file_extension in~ (
Expand Down
6 changes: 6 additions & 0 deletions detection-rules/attachment_office_remote_doc_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ source: |
// office files
.file_extension in~ $file_extensions_macros
or .file_extension in~ $file_extensions_common_archives
or (
.file_extension is null
and .file_type == "unknown"
and .content_type == "application/octet-stream"
and .size < 100000000
)
)
and any(file.explode(.),
.flavors.mime == "text/xml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ severity: "high"
source: |
type.inbound
and any(attachments,
.file_extension in~ $file_extensions_macros
(
.file_extension in~ $file_extensions_macros
or (
.file_extension is null
and .file_type == "unknown"
and .content_type == "application/octet-stream"
and .size < 100000000
)
)
and any(file.explode(.),
1 of (
any(.scan.strings.strings, strings.ilike(., "*Win32_Processor*")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,14 @@ severity: "high"
source: |
type.inbound
and any(attachments,
.file_extension in~ (
// MS Word
"doc",
"docm",
"docx",
"dot",
"dotm",
// MS Excel
"xls",
"xlsx",
"xlsm",
"xlm",
"xlsb",
"xlt",
"xltm",
// MS PowerPoint
"ppt",
"pptx",
"pptm",
"ppsm"
(
.file_extension in~ $file_extensions_macros
or (
.file_extension is null
and .file_type == "unknown"
and .content_type == "application/octet-stream"
and .size < 100000000
)
)
and any(file.explode(.),
any(.scan.strings.strings,
Expand Down
6 changes: 6 additions & 0 deletions detection-rules/attachment_soliciting_enable_macros.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ source: |
(
.file_extension in~ $file_extensions_macros
or .file_extension in~ $file_extensions_common_archives
or (
.file_extension is null
and .file_type == "unknown"
and .content_type == "application/octet-stream"
and .size < 100000000
)
)
and any(file.explode(.),
strings.ilike(.scan.ocr.raw, "*please*enable*macros")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ severity: "high"
source: |
type.inbound
and any(attachments,
.file_extension in~ $file_extensions_macros
(
.file_extension in~ $file_extensions_macros
or (
.file_extension is null
and .file_type == "unknown"
and .content_type == "application/octet-stream"
and .size < 100000000
)
)
and ml.macro_classifier(.).malicious
and ml.macro_classifier(.).confidence in ("high")
)
Expand Down
10 changes: 9 additions & 1 deletion detection-rules/attachment_vba_macro_auto_exec_unsolicited.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ severity: "medium"
source: |
type.inbound
and any(attachments,
.file_extension in~ $file_extensions_macros
(
.file_extension in~ $file_extensions_macros
or (
.file_extension is null
and .file_type == "unknown"
and .content_type == "application/octet-stream"
and .size < 100000000
)
)
and any(file.oletools(.).macros.keywords, .type =~ "autoexec")
)
and (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ source: |
(
.file_extension in~ $file_extensions_macros
or .file_extension in~ $file_extensions_common_archives
or (
.file_extension is null
and .file_type == "unknown"
and .content_type == "application/octet-stream"
and .size < 100000000
)
)
and any(file.explode(.), any(.scan.vba.auto_exec, . == "AutoOpen"))
)
Expand Down
6 changes: 6 additions & 0 deletions detection-rules/attachment_vba_macro_calling_executable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ source: |
(
.file_extension in~ $file_extensions_macros
or .file_extension in~ $file_extensions_common_archives
or (
.file_extension is null
and .file_type == "unknown"
and .content_type == "application/octet-stream"
and .size < 100000000
)
)
and any(file.explode(.), any(.scan.vba.hex, strings.ilike(., "*exe*")))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ source: |
(
.file_extension in~ $file_extensions_macros
or .file_extension in~ $file_extensions_common_archives
or (
.file_extension is null
and .file_type == "unknown"
and .content_type == "application/octet-stream"
and .size < 100000000
)
)
and file.oletools(.).indicators.vba_macros.exists
)
Expand Down
10 changes: 9 additions & 1 deletion detection-rules/attachment_vba_macro_high_risk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ severity: "high"
source: |
type.inbound
and any(attachments,
.file_extension in~ $file_extensions_macros
(
.file_extension in~ $file_extensions_macros
or (
.file_extension is null
and .file_type == "unknown"
and .content_type == "application/octet-stream"
and .size < 100000000
)
)
and file.oletools(.).indicators.vba_macros.risk == "high"
)
and (
Expand Down
11 changes: 10 additions & 1 deletion detection-rules/cve_2021_40444_external_relationship.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@ source: |
type.inbound
and any(attachments,
(
(.file_extension in~ $file_extensions_macros or .file_extension =~ "rtf")
(
.file_extension in~ $file_extensions_macros
or .file_extension =~ "rtf"
or (
.file_extension is null
and .file_type == "unknown"
and .content_type == "application/octet-stream"
and .size < 100000000
)
)
and any(file.oletools(.).relationships, regex.icontains(.target, ".*html:http.*"))
)
or (
Expand Down
6 changes: 6 additions & 0 deletions detection-rules/impersonation_wise_suspicious_attachment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ source: |
or .file_type in $file_extensions_executables
or .file_type in $file_extensions_macros
or .file_type in ("lz")
or (
.file_extension is null
and .file_type == "unknown"
and .content_type == "application/octet-stream"
and .size < 100000000
)
)
and sender.email.domain.root_domain not in~ ('wise.com', 'wise.jobs')
attack_types:
Expand Down

0 comments on commit fa11a71

Please sign in to comment.