New Tool Exposes Hidden Malware Behavior: DispatchLogger Brings Deep Visibility to Windows COM Attacks

Component Object Model (COM) automation remains a foundational part of the Windows ecosystem. It allows programs to interact with system components through structured interfaces instead of directly calling functions like in traditional DLL usage. Many important Windows features, including Windows Management Instrumentation (WMI), rely heavily on COM.

However, this same mechanism is widely abused by modern malware—especially script-based threats. Attackers use COM automation to execute commands, interact with the system, and evade traditional monitoring tools.

In this article, we examine a tool introduced by Cisco Talos called DispatchLogger, which improves visibility into COM interactions. It focuses specifically on late-bound COM calls via the IDispatch interface—an area that has historically been difficult to monitor at scale.


Technical Background

COM automation allows applications to dynamically access objects and invoke methods at runtime. In scripting environments like VBScript, JScript, and PowerShell, this is typically done through late binding using the IDispatch interface.

This design provides flexibility, but also introduces a major blind spot for analysts. Traditional monitoring solutions often capture low-level API calls, but they fail to reveal what is actually happening at the COM level—such as which object is being used, which method is called, and what data is passed.


Threat Landscape and Coverage

Different malware families rely on COM in different ways. Script-based malware tends to rely almost entirely on late binding, making it highly observable with the right tooling.

Malware TypeBinding StyleEstimated Visibility
Windows Script HostFully Late-bound100%
PowerShell COMFully Late-bound100%
AutoITFully Late-bound100%
VBA MacrosMostly Late~95%
VB6 MalwareMixed~65%
.NET COM InteropMixed~60%
C++ MalwareRarely Late~10%

This shows that late-bound COM monitoring is especially effective against modern, fileless, and script-driven threats.


Problem Statement

Modern malware frequently uses COM automation to perform malicious actions such as process execution, persistence, and data exfiltration.

For example, a VBScript sample may create a process using WMI. While endpoint monitoring tools will detect that a process was launched, they often fail to show who initiated it.

In such cases, processes appear to originate from system components like wmic.exe or wmiprvse.exe, masking the real source of execution.

This lack of context significantly slows down analysis and reduces detection accuracy.


Technical Approach

Interception Strategy

DispatchLogger addresses this issue by intercepting COM object creation at the API level. Instead of modifying malware behavior, it introduces transparent proxy objects that sit between the malware and the actual COM interface.

The following APIs are intercepted:

  • CoCreateInstance
  • CoGetClassObject
  • GetActiveObject
  • CoGetObject
  • MkParseDisplayName
  • CLSIDFromProgID

By targeting these entry points, the tool ensures that nearly all COM object creation paths are covered.


Why Class Factory Hooking Matters

Initial testing revealed that simply hooking CoCreateInstance was not enough. Many scripting engines—especially VBScript—first request an IUnknown interface before later querying for IDispatch.

This behavior exists because the scripting engine performs internal validation before accessing automation features.

To overcome this, DispatchLogger also hooks CoGetClassObject and wraps the returned IClassFactory. This allows interception regardless of which interface is requested first.


Architecture Overview

Proxy-Based Design

At the core of the system is a proxy class that implements the IDispatch interface. This proxy forwards all method calls to the original object while logging:

  • Method names
  • Arguments
  • Return values

If a method returns another COM object, the tool automatically wraps that object as well.


Recursive Object Tracking

One of the most powerful features is recursive wrapping. Every object returned during execution is inspected and, if applicable, wrapped again.

This creates a fully observable chain of interactions.

For example:

  • A script calls GetObject("winmgmts:")
  • The returned WMI object is wrapped
  • A query method is invoked and logged
  • The result set is wrapped
  • Each item retrieved from the result is also wrapped

This allows analysts to track behavior across the entire object lifecycle.


Enumerator and Moniker Handling

Iteration in scripting languages relies on IEnumVARIANT. DispatchLogger intercepts this interface to ensure objects retrieved during loops are also captured.

Additionally, moniker-based object access (used in functions like GetObject) is handled by intercepting binding functions such as BindToObject.

This ensures visibility into WMI and other indirect object access mechanisms.


Implementation Details

Interface Coverage

COM interfaces require full implementation, not partial hooks. The tool replicates multiple interfaces:

InterfaceTotal MethodsLoggedWrapped
IDispatch741
IEnumVARIANT711
IClassFactory521
IMoniker2611

Each proxy instance maintains a one-to-one mapping with the original COM object.


Thread Safety and Object Management

To handle concurrent execution, the tool uses synchronization mechanisms (critical sections) when tracking objects globally.

It also carefully manages reference counting to ensure compatibility with COM’s lifecycle rules, preventing crashes or detection.


Observed Output and Analysis Value

During execution, DispatchLogger produces detailed logs that include:

  • Object creation events with CLSIDs
  • Method calls with resolved names
  • Parameters and argument values
  • Returned objects and their relationships

This provides a much clearer understanding of malware behavior compared to traditional logging.

It allows analysts to reconstruct attacker actions with high precision.


Deployment Model

DispatchLogger is deployed as a DLL and injected into the target process.

Once active, it:

  • Hooks COM-related APIs
  • Initializes logging mechanisms
  • Begins capturing interactions in real time

Importantly, no modification to the malware sample is required.


Comparison with Traditional Techniques

MethodVisibility LevelContext AwarenessRisk
Static AnalysisLimited (obfuscation)NoneLow
API MonitoringLow-level onlyPartialMedium
Memory ForensicsSnapshot-basedLimitedLow
DebuggingManualHighHigh
DispatchLoggerHigh-level COM insightFullLow

DispatchLogger clearly stands out in terms of semantic visibility.


Performance Considerations

The performance overhead introduced is minimal:

  • Only one additional function dispatch per call
  • Constant-time object wrapping
  • No impact on non-COM operations

In testing scenarios, execution delays were negligible.


Limitations

Despite its strengths, the current implementation has some constraints:

  • Limited support for advanced COM interfaces (e.g., IDispatchEx)
  • No built-in handling for out-of-process COM (DCOM)
  • Partial support for multi-threaded edge cases
  • Dependency on type libraries for method resolution
  • Limited testing in 64-bit environments

These limitations may affect coverage in certain advanced scenarios.


Operational Use Case

A typical workflow would involve:

  • Setting up a controlled analysis environment
  • Injecting the tool into the target process
  • Running the suspected malware
  • Reviewing generated logs
  • Extracting indicators of compromise (IOCs)

This approach is particularly useful for analyzing fileless malware and living-off-the-land techniques.


CyberP1 Assessment

From a defensive standpoint, DispatchLogger fills a critical visibility gap in Windows malware analysis. Traditional tools often stop at API-level observation, which is no longer sufficient for modern threats that rely heavily on abstraction layers like COM.

What makes this approach effective is its ability to capture intent, not just execution. By observing method names, parameters, and object relationships, analysts can understand why something happened—not just what happened.

However, its dependency on COM internals also means it requires deep technical understanding to deploy and interpret correctly. Additionally, attackers could potentially shift toward techniques that bypass IDispatch altogether, although this would increase their development complexity.

Overall, this method represents a strong advancement in behavioral analysis, especially against script-based and fileless malware.


Conclusion

DispatchLogger demonstrates that even long-standing Windows technologies like COM can be leveraged for modern threat detection when instrumented correctly.

By intercepting COM interactions at the right level and maintaining transparency, it enables deep behavioral insight without interfering with malware execution.

This makes it a valuable addition to the toolkit of malware analysts and SOC teams dealing with increasingly sophisticated threats.