Skip to content
leg3ndProjects & tools
01Home02Projects03Tools04Notes
GMT+8
O/ OSCP exploitation reference
Workspace controls Memory only · 0 steps
Visualize path ↗
Command values 0 filled

Temporary connection values clear on reload. Passwords, hashes and tickets remain placeholders. Check address-family syntax in the selected command.

Reference index ↗ Search all procedures & variants ↗
01Discovery02Enumeration03Initial access04Usable access05Local privilege06Active Directory07Internal access08Evidence & reporting

QUICK REFERENCE

Discovery›Services›Web mapping›Web exploitation›Credentials›Public exploits›Sessions & transfers›Linux escalation›Windows escalation›AD enumeration›AD identity attacks›Lateral movement›Pivoting & tunnels›Execution troubleshooting›Integration & evidence›
174 methods · 15 topicsFull reference on GitHub ↗Commands · scripts · next steps
Tools/OSCP/Active Directory/Lateral movement
← All lateral movement tasks

Execute through WMI or native CIM over DCOM

CommandsIf → thenExplanation & examples

Needs: RPC endpoint mapper plus negotiated dynamic ports; effective WMI/DCOM rights; the selected output path may additionally need SMB

Shell commands

# Baseline
impacket-wmiexec 'DOMAIN/USER:PASSWORD@TARGET'
impacket-wmiexec -hashes :NT_HASH 'DOMAIN/USER@TARGET'

# Kerberos with separate name and route
export KRB5CCNAME="$PWD/USER.ccache"
impacket-wmiexec -k -no-pass -dc-ip DC_IP -target-ip TARGET_IP 'DOMAIN/USER@TARGET_HOST'

# One command, no SMB output
impacket-wmiexec -nooutput 'DOMAIN/USER:PASSWORD@TARGET' "cmd.exe /c echo MOVEMENT_OK > C:\Windows\Temp\movement-proof.txt"

One command, no SMB output

# One command, no SMB output
$Credential = Get-Credential 'DOMAIN\USER'
$Options = New-CimSessionOption -Protocol Dcom
$Session = New-CimSession -ComputerName TARGET_HOST -Credential $Credential -SessionOption $Options

Invoke-CimMethod -CimSession $Session -ClassName Win32_Process -MethodName Create -Arguments @{
  CommandLine = 'cmd.exe /c hostname > C:\Windows\Temp\movement-proof.txt'
}

Remove-CimSession $Session

Verify → Verify destination process/effect and execution identity separately from captured stdout.

If it fails → Port 135 alone is insufficient. Distinguish RPC route, namespace permission, output share and local token filtering. More detail ↓

If → then

  • A PoC, injected command or remote client reports execution → Verify command execution, host and represented identity

    Needs: A functioning execution primitive and an observable output or controlled side effect

  • Command execution or payload delivery exists but the expected usable channel does not → Diagnose connection direction, listener and session failures in order

    Needs: A recorded first execution proof, correct advertised route, active compatible listener and observable connection evidence

  • A WinRM listener and a candidate endpoint-authorized account → Use WinRM, WinRS or PowerShell remoting

    Needs: Reachable HTTP(S) listener, accepted authentication and endpoint/session configuration permissions; hash/ticket support depends on client/context

No useful finding → another task in this topic. Failed check → resolve the failure before ruling out the path.

Explanation & examples

Execute through WMI or native CIM over DCOM

USE WHEN
A destination exposes WMI/DCOM and the identity has useful namespace/process rights
STARTING ACCESS
Identified authentication material, destination service reachability and a candidate authorized identity
RESULT
A remote process effect and, when available, retrieved command output

Recognize the clue

Investigate WMI from RPC/service inventory and exact account rights; keep process creation and SMB-based output retrieval as separate legs.

Test-NetConnection TARGET -Port 135
Test-NetConnection TARGET -Port 445
SYNTHETIC EXAMPLE OUTPUT
Endpoint mapper: reachable
SMB output path: reachable
Dynamic RPC and WMI namespace rights: unknown

Means: Port 135 and an output route justify further checks but do not prove a WMI process can be created.

Confirm: Validate dynamic ports, DCOM/WMI authorization, native CIM transport choice and actual effect.

After validation
Authorized process creation plus a working observation/output path exists: use WMI/CIM.
Ruled out in this context
The required namespace/activation permission is denied: reject that identity's WMI route.
Still inconclusive
Execution may succeed with failed output retrieval; inspect a controlled effect before concluding.

Troubleshooting: Port 135 alone is insufficient. Distinguish RPC route, namespace permission, output share and local token filtering.

WMIExec creates processes through WMI/DCOM. Its normal output channel uses SMB and defaults to ADMIN$; therefore a WMI process may run even when output retrieval fails. -nooutput or -silentcommand changes that evidence channel.

Kerberos with separate name and route:

One command, no SMB output

Verify the harmless artifact through an independently authorized channel. No returned stdout is expected.

ReturnValue = 0 and a process ID confirm process creation, not its final effect. WMI-created processes run in session 0; GUI programs will not appear on an interactive desktop.

Why it works

WMI can create a process while SMB output retrieval fails. Modern CIM defaults can use WSMan, so select the documented DCOM session option when that transport is intended.

Worked example · hypothetical

Observation: WMIExec appears to hang after process creation. Test: check the controlled effect independently and inspect SMB output access. Illustrative output: the process ran but the share read was denied. Interpretation: execution is proven; repair the output channel or use another observation.

New identity, privilege, host or route? Re-enumerate → All topic tasks →

Study guide ↗Full procedure ↗Cheatsheet ↗
HomeProjectsToolsNotes
Interactive toolsOSCP notes ↗Extended OSCP workspace ↗Attack-path visualizer ↗

© 2026 Armaan. Built with curiosity.

GitHub ↗GMT+8