Over DCOM
Component Object Model (COM)
is a Microsoft standard for inter-process communication. COM
specifies an object model and programming requirements that enable COM objects
(also called COM components
) to interact with one another. A COM object
defines one, or more, sets of functions (methods
), called interfaces
, that are the only way to manipulate the data associated with the object. A COM server
object provides services to COM clients
through its implemented methods
, called by the clients after retrieving a pointer to the COM server
object interface.
The proprietary Microsoft Distributed Component Object Model (DCOM)
technology allows for networked communication of COM objects
over the Microsoft Remote Procedure Call (MSRPC)
protocol, with a first connection initiated on the remote system port TCP 135.
The COM
/ DCOM
object register a few notable identifiers:
The
Class Identifier (CLSID)
, aGUID
acting as a unique identifier for everyCOM class
registered in Windows. TheCLSID key
in the registry points to the implementation of the class.The optional
Programmatic Identifier (ProgID)
, that can supplement aCOM class
CLSID
with a more human-readable name. Not everyCOM class
is associated with aProgID
.The
Application Identifier (AppID)
, which groups the configuration for one, or more,DCOM objects
hosted by the same executable into one centralized location in the registry (HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ AppID\{<APPID>}
).
The configuration defined in AppID
notably specify, the form of Access Control List (ACL)
, the following permissions:
Launch Permissions
, that restrict the security principals that can locally or remotely start theDCOM object
serverAccess Permissions
, that restrict the security principals that can locally or remotely access theDCOM object
methodsConfiguration Permissions
, that restrict the security principals that can modify the configuration of theDCOM
objects.
System-wide limits are defined and control the minimal level of restrictions DCOM applications
can set. By default, Everyone
and non authenticated users (ANONYMOUS LOGON
) may be granted local or remote access to DCOM object
methods while only members of the local Administrators
, Distributed COM Users
, and Performance Log Users
may be granted remote launch
and activation
rights.
If the Access Permissions
is left unspecified in the AppID
configuration, the system-wide Access Permissions
and Launch Permissions
are applied. By default, the Remote Access
right is only granted to the Windows local built-in Administrators
group. The AppID
registered on a system can be browsed and edited using the dcomcnfg.exe
Windows built-in utility or, the dedicated OleViewDotNet
.NET utility.
A client request the instantiation of a remote DCOM
object class by specifying its CLSID
or ProgID
, the later being resolved to the associated CLSID
. The DCOMLaunch
service (C:\Windows\system32\svchost.exe -k DcomLaunch
, for DCOM objects
from an exe
binary) or DLLHOST.exe
(for DCOM objects
from a DLL
) then instantiate the requested DCOM
object class, on condition that the client has the necessary access permissions (as defined in the APPID
configuration). The error code 80070005
(for E_ACCESSDENIED
) will be returned otherwise.
CLSID enumeration
PowerShell can be used to list the CLSID
and ProdID
properties of the DCOM objects
registered on the local computer HKEY_CLASSES_ROOT
registry hive. The HKEY_CLASSES_ROOT
registry hive cannot be directly accessed on a remote computer using Get-ChildItem
. In order to remotely access the HKEY_CLASSES_ROOT
registry hive, the following PowerShell commands can be run over WinRM
using the Invoke-Command
PowerShell cmdlet.
Code execution over DCOM
Multiple DCOM objects
classes can be leveraged to execute commands on the remote system. The idea of using DCOM objects
for lateral movements having come to light recently, in January 2017 after a publication by enigma0x3
, the below list, mostly gathered from https://www.cybereason.com/blog/dcom-lateral-movement-techniques
, is possibly far from being exhaustive.
PowerShell and Impacket
's dcomexec.py
Python script can be used to execute commands through DCOM
objects:
Last updated