Detection rules › Splunk
Expand.exe Execution (PowerShell)
expand.exe is a legitimate Windows utility used to extract files from compressed .cab archives. Threat actors have been observed abusing expand.exe to unpack malicious payloads hidden within .cab files on compromised systems. This use case detects expand.exe executions with .cab file extensions or references to suspicious path locations. Allowlisting expected processes with full file paths and command lines where possible is recommended for best fidelity
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth | T1564.004 Hide Artifacts: NTFS File Attributes |
| Command & Control | T1105 Ingress Tool Transfer |
References
- https://lolbas-project.github.io/lolbas/Binaries/Expand/
- https://github.com/SigmaHQ/sigma/blob/c04bef2fbbe8beff6c7620d5d7ea6872dbe7acba/rules/windows/process_creation/proc_creation_win_expand_cabinet_files.yml
- https://www.threatdown.com/blog/new-variant-of-konni-malware-used-in-campaign-targetting-russia/
- https://www.sygnia.co/blog/ghost-emperor-demodex-rootkit/
Event coverage
| Provider | Event | Title |
|---|---|---|
| PowerShell | Event ID 4103 | Payload Context: ContextInfo User Data: UserData. |
| PowerShell | Event ID 4104 | Creating Scriptblock text (MessageNumber of MessageTotal). |
Rule body yaml
id: '35367.62270'
title: Expand.exe Execution
description: expand.exe is a legitimate Windows utility used to extract files from
compressed .cab archives. Threat actors have been observed abusing expand.exe to
unpack malicious payloads hidden within .cab files on compromised systems. This
use case detects expand.exe executions with .cab file extensions or references to
suspicious path locations. Allowlisting expected processes with full file paths
and command lines where possible is recommended for best fidelity. Living Off the
Land Binary and Scripts (LOLBAS) (LOLBIN)
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4103) OR
"<EventID>4103<" OR TERM(EventCode=4104) OR "<EventID>4104<") "expand.exe" (".cab"
OR "/F:" OR "-F:" OR "\\ProgramData" OR "\\Public" OR "\\AppData\\Local\\Temp\\"
OR "\\AppData\\Roaming\\Temp\\") | where match(process, "(?i)\.cab|(-|\/)F:|\x5cAppData\x5c|(Local|Roaming)\x5cTemp\x5c")
and not match(process, "(?i):\x5cProgramData\x5cDell\x5cUpdateService\x5cTemp\x5c")
| table _time, host, user, process, process_name, parent_process_path, parent_process_name
| bin span=1s | stats values(*) as * by _time, host '
techniques:
- command-and-control:ingress tool transfer
- defense-evasion:hide artifacts:ntfs file attributes
technique_id:
- T1105
- T1564.004
data_category:
- PowerShell logs
references:
- https://lolbas-project.github.io/lolbas/Binaries/Expand/
- https://github.com/SigmaHQ/sigma/blob/c04bef2fbbe8beff6c7620d5d7ea6872dbe7acba/rules/windows/process_creation/proc_creation_win_expand_cabinet_files.yml
- https://www.threatdown.com/blog/new-variant-of-konni-malware-used-in-campaign-targetting-russia/
- https://www.sygnia.co/blog/ghost-emperor-demodex-rootkit/
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4103) OR "<EventID>4103<" OR TERM(EventCode=4104) OR "<EventID>4104<") "expand.exe" (".cab" OR "/F:" OR "-F:" OR "\\ProgramData" OR "\\Public" OR "\\AppData\\Local\\Temp\\" OR "\\AppData\\Roaming\\Temp\\")
Stage 2: where
| where match(process, "(?i)\.cab|(-|\/)F:|\x5cAppData\x5c|(Local|Roaming)\x5cTemp\x5c") and not match(process, "(?i):\x5cProgramData\x5cDell\x5cUpdateService\x5cTemp\x5c")
Stage 3: table
| table _time, host, user, process, process_name, parent_process_path, parent_process_name
Stage 4: bucket
| bin span=1s
Stage 5: stats
| stats values(*) as * by _time, host
Exclusions
Top-level NOT(...) conjuncts: predicates this rule actively suppresses.
| Field | Kind | Excluded values |
|---|---|---|
process | match | "(?i):\x5cProgramData\x5cDell\x5cUpdateService\x5cTemp\x5c" |
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.
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.
| Stage | Term |
|---|---|
| 1 | TERM |
| 1 | "<EventID>4103<" |
| 1 | TERM |
| 1 | "<EventID>4104<" |
| 1 | "expand.exe" |
| 1 | ".cab" |
| 1 | "/F:" |
| 1 | "-F:" |
| 1 | "\\ProgramData" |
| 1 | "\\Public" |
| 1 | "\\AppData\\Local\\Temp\\" |
| 1 | "\\AppData\\Roaming\\Temp\\" |