135 - WMI

Windows Management Instrumentation (WMI) is a Windows feature that allows administrators to remotely manage and monitor systems. It is used to query system information, configure settings, execute commands, and automate administrative tasks across local or remote machines.

By default, WMI uses DCOM for remote communication. It connects first over RPC on port 135, then switches to dynamically assigned high ports (typically 49152–65535) to exchange data. Remote WMI access usually requires administrative privileges unless specific permissions are delegated.

Enumeration

# Scan ports
nmap -p135,49152-65535 10.129.229.244 -sV

# Test credentials
nxc wmi 10.129.229.244 -u helen -p RedRiot88

Lateral Movement

Windows

circle-exclamation

We can interact with WMI using wmicarrow-up-right or various PowerShell cmdlets to query and manage various aspects of the Windows operating system programmatically through different classes.

Class
Usage

Win32_OperatingSystem

Details about the operating system

Win32_Process

Manage processes

Win32_Service

Handle services

Win32_ComputerSystem

Overall system information

We can also use WMI to achieve RCE for performing admin tasks, such as manage processes, run scripts, or change system configurations.

Linux

The wmi-clientarrow-up-right is a tool that allows remote communication with Windows systems using WMI. The client connects to Windows machines by using DCOM and RPC, which are Microsoft technologies for remote communication. Through these mechanisms, it can query system information or execute management tasks on older Windows systems such as Windows 2000, XP, and Server 2003.

The wmiexec.pyarrow-up-right from Impacket can also be used for RCE. This script requires the SMB port (445) open to work as it uses it for retrieving the command output.

NetExecarrow-up-right can be also used to query information or RCE via WMI. This tools receives the command output via WMI rather than SMB.

Last updated