Detection rules › Splunk

Windows DLL Side-Loading In Calc

Author
Teoderick Contreras, Splunk
Source
upstream

The following analytic detects the loading of the "WindowsCodecs.dll" by calc.exe from a non-standard location This could be indicative of a potential DLL side-loading technique. This detection leverages Sysmon EventCode 7 to identify the DLL side-loading activity. In previous versions of the "calc.exe" binary, namely on Windows 7, it was vulnerable to DLL side-loading, where an attacker is able to load an arbitrary DLL named "WindowsCodecs.dll". This technique has been observed in Qakbot malware. This activity is significant as it indicates potential malware execution through a trusted process, which can bypass security controls. If confirmed malicious, this could allow attackers to execute arbitrary code, maintain persistence, and escalate privileges within the environment.

MITRE ATT&CK coverage

TacticTechniques
PersistenceT1574.001 Hijack Execution Flow: DLL
Privilege EscalationT1574.001 Hijack Execution Flow: DLL
Defense EvasionT1574.001 Hijack Execution Flow: DLL

Event coverage

ProviderEvent IDTitle
Sysmon7Image loaded

Stages and Predicates

Stage 1: search

search NOT (NOT ImageLoaded IN ("*:\\Windows\\SysWOW64\\*", "*:\\Windows\\System32\\*", "*:\\Windows\\WinSXS\\*") Image IN ("*:\\Windows\\SysWOW64\\*", "*:\\Windows\\System32\\*")) EventCode=7 Image="*\\calc.exe" ImageLoaded="*\\WindowsCodecs.dll"

Stage 2: fillnull

fillnull

Stage 3: stats

stats BY Image, ImageLoaded, dest, loaded_file, loaded_file_path, original_file_name, process_exec, process_guid, process_hash, process_id, process_name, process_path, service_dll_signature_exists, service_dll_signature_verified, signature, signature_id, user_id, vendor_product

Stage 4: search

search

Stage 5: search

search

Stage 6: search

search `macro`

Exclusions

Top-level NOT(...) conjuncts — predicates this rule actively suppresses.

StageFieldKindExcluded values
1ImageLoadedin"*:\\Windows\\SysWOW64\\*", "*:\\Windows\\System32\\*", "*:\\Windows\\WinSXS\\*"
2Imagein"*:\\Windows\\SysWOW64\\*", "*:\\Windows\\System32\\*"

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
  • 7 corpus 35 (splunk 35)
Imageeq
  • "*\\calc.exe"
ImageLoadedeq
  • "*\\WindowsCodecs.dll"
ImageLoadedin
  • "*:\\Windows\\SysWOW64\\*"
  • "*:\\Windows\\System32\\*"
  • "*:\\Windows\\WinSXS\\*"

Neighbors

Broader alternatives (more inclusive than this rule)

These rules match a superset of what this rule catches. They cover the same events plus more. Use them if you want wider coverage and can absorb more false positives.