Detection rules › Splunk
DLL Concatenation (Windows Event Log)
Threat actors were observed using Impacket to concatenate the malicious proxy tool Stowaway (msoe.dll) with all DLLs starting with 'd' from the system32 directory into a single DLL (appmgmt.dll) to pad and obfuscate the malicious DLL, thereby facilitating its deployment and evasion. This use case detects copy commands followed by either *.dll or multiple .dll references, indicating possible attempts to concatenate multiple DLLs into a single file. NOTE: For commands using 'copy' or 'type', they must be executed in a way that creates a new process, e.g. with cmd /c or powershell -c, as they are built-in commands that run within the current cmd session and do not create new processes on their own.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
References
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule body
id: '33834.59905'
title: DLL Concatenation
description: 'Threat actors were observed using Impacket to concatenate the malicious
proxy tool Stowaway (msoe.dll) with all DLLs starting with ''d'' from the system32
directory into a single DLL (appmgmt.dll) to pad and obfuscate the malicious DLL,
thereby facilitating its deployment and evasion. This use case detects copy commands
followed by either *.dll or multiple .dll references, indicating possible attempts
to concatenate multiple DLLs into a single file. NOTE: For commands using ''copy''
or ''type'', they must be executed in a way that creates a new process, e.g. with
cmd /c or powershell -c, as they are built-in commands that run within the current
cmd session and do not create new processes on their own.'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
"<EventID>4688<" OR Type=Process) (TERM(copy) OR TERM(robocopy) OR TERM(xcopy) OR
((TERM(type) OR TERM(Get-Content) OR "gc" OR "cat" OR TERM(more)) ">")) ".dll" |
regex process="(?i)(copy|more|Get-Content|type|cat|gc)\s+.*?((\/b\s+\S+\.dll\s+\+\s*\S+\.dll)|(\*\.dll\s+\S+)|(\.dll.*\.dll))"|
table _time, host, user, process, process_*, parent_* | bin span=1s | stats values(*)
as * by _time, host '
techniques:
- defense-evasion:masquerading
- defense-evasion:obfuscated files or information:binary padding
technique_id:
- T1036
- T1027.001
data_category:
- Process command-line parameters
- Windows event logs
references:
- https://attack.mitre.org/techniques/T1027/001/
- https://news.sophos.com/en-us/2024/06/05/operation-crimson-palace-a-technical-deep-dive/
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) (TERM(copy) OR TERM(robocopy) OR TERM(xcopy) OR ((TERM(type) OR TERM(Get-Content) OR "gc" OR "cat" OR TERM(more)) ">")) ".dll"
Stage 2: regex
| regex process="(?i)(copy|more|Get-Content|type|cat|gc)\s+.*?((\/b\s+\S+\.dll\s+\+\s*\S+\.dll)|(\*\.dll\s+\S+)|(\.dll.*\.dll))"
Stage 3: table
| table _time, host, user, process, process_*, parent_*
Stage 4: bucket
| bin span=1s
Stage 5: stats
| stats values(*) as * by _time, host
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
EventCode | eq |
| field:"EventID" kind:eq value:"4688" |
process | regex_match |
| field:"CommandLine" kind:regex_match |
Search terms
These SPL tokens match against raw event text.
| Stage | Term |
|---|---|
| 1 | "<EventID>4688<" |
| 1 | copy |
| 1 | robocopy |
| 1 | xcopy |
| 1 | type |
| 1 | "Get-Content" |
| 1 | "gc" |
| 1 | "cat" |
| 1 | more |
| 1 | ">" |
| 1 | ".dll" |