Detection rules › Splunk

Potential Executable Masquerading as Document - Windows (Sysmon)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

Adversaries may abuse double extensions to attempt to conceal dangerous file types of payloads. This use case detects executions of files that appear to be document or image files but execute as script or executable files, or executable/script files with 3 or more spaces or underscores preceding the extension in an effort to obscure the file's actual extension. CVE-2023-38831

MITRE ATT&CK coverage

References

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

id: '21579.38122'
title: Potential Executable Masquerading as Document - Windows
description: 'Adversaries may abuse double extensions to attempt to conceal dangerous
  file types of payloads. This use case detects executions of files that appear to
  be document or image files but execute as script or executable files, or executable/script
  files with 3 or more spaces or underscores preceding the extension in an effort
  to obscure the file''s actual extension. CVE-2023-38831 -- Threat Actor Association:
  APT28, APT40, Sandworm Team, UAC-0057 (GhostWriter)'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_sysmon` (TERM(EventCode=1) OR "<EventID>1<")
  (".pdf" OR ".jpg" OR ".jpeg" OR "gif" OR ".ico" OR ".doc" OR ".xls" OR ".docx" OR
  ".xlsx" OR ".png" OR ".xml" OR ".csv" OR ".ppt" OR ".pptx" OR ".rtf" OR ".txt")
  (".cmd" OR ".bat" OR ".ps1" OR ".vbs" OR ".js" OR ".py" OR ".exe" OR ".msi" OR ".vbe"
  OR ".lnk" OR ".scr") | regex process="(?i)((\s{3,}|_{3,})|(\.(pdf|jpg|jpeg|gif|ico|doc|xls|docx|xlsx|png|xml|csv|ppt|pptx|rtf|txt)(\s+)?))\.(cmd|bat|ps1|vbs|js|py|exe|msi|vbe|lnk|scr)"
  | table _time, host, user, process, process_*, parent_process_* | bin span=1s |
  stats values(*) as * by _time, host '
techniques:
- defense-evasion:masquerading:double file extension
technique_id:
- T1036.007
data_category:
- Windows Sysmon
- Process command-line parameters
references:
- https://www.group-ib.com/blog/cve-2023-38831-winrar-zero-day/
- https://www.microsoft.com/en-us/security/blog/2024/01/17/new-ttps-observed-in-mint-sandstorm-campaign-targeting-high-profile-individuals-at-universities-and-research-orgs/

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_sysmon` (TERM(EventCode=1) OR "<EventID>1<") (".pdf" OR ".jpg" OR ".jpeg" OR "gif" OR ".ico" OR ".doc" OR ".xls" OR ".docx" OR ".xlsx" OR ".png" OR ".xml" OR ".csv" OR ".ppt" OR ".pptx" OR ".rtf" OR ".txt") (".cmd" OR ".bat" OR ".ps1" OR ".vbs" OR ".js" OR ".py" OR ".exe" OR ".msi" OR ".vbe" OR ".lnk" OR ".scr")

Stage 2: regex

| regex process="(?i)((\s{3,}|_{3,})|(\.(pdf|jpg|jpeg|gif|ico|doc|xls|docx|xlsx|png|xml|csv|ppt|pptx|rtf|txt)(\s+)?))\.(cmd|bat|ps1|vbs|js|py|exe|msi|vbe|lnk|scr)"

Stage 3: table

| table _time, host, user, process, process_*, parent_process_*

Stage 4: bucket

| bin span=1s

Stage 5: stats

| stats values(*) as * by _time, host

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
EventCodeeq
  • 1 corpus 237 (splunk 224, kusto 13)
processregex_match
  • "(?i)((\s{3,}|_{3,})|(.(pdf|jpg|jpeg|gif|ico|doc|xls|docx|xlsx|png|xml|csv|ppt|pptx|rtf|txt)(\s+)?)).(cmd|bat|ps1|vbs|js|py|exe|msi|vbe|lnk|scr)" corpus 2 (splunk 2)

Search terms

Bare-string tokens in the SPL search body. Splunk matches each token against _raw (the untyped raw event text) anywhere it appears, not against a specific field. These don't surface in the Indicators table because they aren't predicates on a known field.

StageTerm
1TERM
1"<EventID>1<"
1".pdf"
1".jpg"
1".jpeg"
1"gif"
1".ico"
1".doc"
1".xls"
1".docx"
1".xlsx"
1".png"
1".xml"
1".csv"
1".ppt"
1".pptx"
1".rtf"
1".txt"
1".cmd"
1".bat"
1".ps1"
1".vbs"
1".js"
1".py"
1".exe"
1".msi"
1".vbe"
1".lnk"
1".scr"