Distributed Component Object Model
Last updated
Last updated
Adversaries may use Valid Accounts to interact with remote machines by taking advantage of Distributed Component Object Model(DCOM). The adversary may then perform actions as the logged-on user.
The Windows Component Object Model(COM) is a component of the native Windows application programming interface(API) that enables interaction between software objects, or executable code that implements one or more interfaces. Through COM, a client object can call methods of server objects, which are typically Dynamic Link Libraries(DLL) or executables (EXE). Distributed COM (DCOM) is transparent middleware that extends the functionality of COM beyond a local computer using remote procedure call (RPC) technology.
Permissions to interact with local and remote server COM objects are specified by access control lists(ACL) in the Registry. By default, only Administrators may remotely activate and launch COM objects through DCOM.
Through DCOM, adversaries operating in the context of an appropriately privileged user can remotely obtain arbitrary and even direct shellcode execution through Office applications as well as other Windows objects that contain insecure methods. DCOM can also execute macros in existing documents and may also invoke Dynamic Data Exchange(DDE) execution directly through a COM created instance of a Microsoft Office application bypassing the need for a malicious document.
Example
Component Object Model (COM) is a protocol used by processes with different applications and languages so they communicate with one another. COM objects cannot be used over a network, which introduced the Distributed COM (DCOM) protocol Matt Nelson discovered a lateral movement technique via DCOM, using the ExecuteShellCommand Method in the Microsoft Management Console (MMC) 2.0 scripting object model which is used for System Management Server administrative functions.
COM is a component of the native Windows application programming interface (API) that enables interaction between software objects, or executable code that implements one or more interfaces. Through COM, a client object can call methods of server objects, which are typically Dynamic Link Libraries (DLL) or executables (EXE). DCOM is transparent middle ware that extends the functionality of Component Object Model (COM) beyond a local computer using remote procedure call (RPC) technology.
So let's work on a quick technique, I will execute the calculator on the remote host using DCOM.The user will need Admin privileges on the Host machine to access the MMC 2.0 method and also Admin privileges on the Remote machine to execute.
$com = [activator]::CreateInstance([type]::GetTypeFromProgID("MMC20.Application","TARGET IP"))
$com.Document.ActiveView.ExecuteShellCommand("C:\Windows\System32\Calc.exe",$null,$null,"7")
DCOM Demo