Skip to content
Threat Feed
medium advisory

Abuse of PowerShell MSXML COM Objects for Network Interaction

Adversaries leverage the MSXML2 COM object within PowerShell scripts to facilitate network communication and potential code execution.

Adversaries frequently abuse PowerShell's ability to interact with COM objects to perform stealthy network operations or fetch remote payloads. Specifically, the use of MsXml2.ServerXmlHttp or MsXml2.XMLHTTP allows scripts to bypass traditional browser-based security controls when performing HTTP requests. This technique is often observed during the post-exploitation phase, where attackers attempt to download secondary stages or exfiltrate data. By invoking these COM objects, a script can instantiate an HTTP client directly within the PowerShell process memory, making the activity harder to distinguish from legitimate background administrative traffic. Defenders should monitor for the instantiation of these specific COM objects in conjunction with PowerShell, as this is a common TTP used by botnets and remote access trojans to establish C2.

Impact

Successful abuse of this technique enables an attacker to maintain persistent communication with command-and-control infrastructure, download additional malicious tools, and exfiltrate sensitive data from the host. This activity has been observed in various botnet campaigns where PowerShell is used for automated payload delivery.

Recommendation

  • Enable PowerShell Script Block Logging (Event ID 4104) to capture the full command line and script body.
  • Deploy the provided Sigma rule to detect the specific combination of 'New-Object', '-ComObject', and MSXML components in script blocks.
  • Baseline administrative scripts in the environment to reduce false positives associated with legitimate use of COM objects for network tasks.

Immediate actions

Enable PowerShell Script Block Logging (Event ID 4104)

IT Operations 72h

Threat Hunt

Search for historical instances of MSXML2 usage in PowerShell logs

T1059.001 medium medium confidence hunt now

Data: Event ID 4104

Mitigations

Implement constrained PowerShell language mode

medium IT Security

General PowerShell abuse

Detection coverage 1

Detect PowerShell MSXML COM Object Usage

medium

Detects usage of MSXML2 COM objects within PowerShell scripts, a technique often used to perform network requests for payload staging or exfiltration.

sigma tactics: execution techniques: T1059.001 sources: ps_script, windows

Detection queries are available on the platform. Get full rules →