WMI
Installation
Install NetExec.
Usage
netexec wmi [-h] [--version] [-t THREADS] [--timeout TIMEOUT] [--jitter INTERVAL] [--no-progress] [--log LOG] [--verbose | --debug] [-6] [--dns-server DNS_SERVER] [--dns-tcp]
[--dns-timeout DNS_TIMEOUT] [-u USERNAME [USERNAME ...]] [-p PASSWORD [PASSWORD ...]] [-id CRED_ID [CRED_ID ...]] [--ignore-pw-decoding] [--no-bruteforce] [--continue-on-success]
[--gfail-limit LIMIT] [--ufail-limit LIMIT] [--fail-limit LIMIT] [-k] [--use-kcache] [--aesKey AESKEY [AESKEY ...]] [--kdcHost KDCHOST] [--pfx-cert PFXCERT] [--pfx-base64 PFXB64]
[--pfx-pass PFXPASS] [--pem-cert PEMCERT] [--pem-key PEMKEY] [-M MODULE] [-o MODULE_OPTION [MODULE_OPTION ...]] [-L [LIST_MODULES]] [--options] [-H HASH [HASH ...]] [--port {135}]
[--rpc-timeout RPC_TIMEOUT] [-d DOMAIN | --local-auth] [--list-snapshots [LIST_SNAPSHOTS]] [--wmi-query QUERY] [--wmi-namespace NAMESPACE] [--no-output] [-x COMMAND] [-X COMMAND]
[--exec-method {wmiexec,wmiexec-event}] [--exec-timeout exec_timeout] [--codec CODEC]
target [target ...]Flags
positional arguments:
target the target IP(s), range(s), CIDR(s), hostname(s), FQDN(s), file(s) containing a list of targets, NMap XML or .Nessus file(s)
options:
-h, --help show this help message and exit
-H, --hash HASH [HASH ...]
NTLM hash(es) or file(s) containing NTLM hashes
--port {135} WMI port (default: 135)
--rpc-timeout RPC_TIMEOUT
RPC/DCOM(WMI) connection timeout, default is 2 seconds
-d DOMAIN Domain to authenticate to
--local-auth Authenticate locally to each target
Generic Options:
--version Display nxc version
-t, --threads THREADS
set how many concurrent threads to use
--timeout TIMEOUT max timeout in seconds of each thread
--jitter INTERVAL sets a random delay between each authentication
Output Options:
--no-progress do not displaying progress bar during scan
--log LOG export result into a custom file
--verbose enable verbose output
--debug enable debug level information
DNS:
-6 Enable force IPv6
--dns-server DNS_SERVER
Specify DNS server (default: Use hosts file & System DNS)
--dns-tcp Use TCP instead of UDP for DNS queries
--dns-timeout DNS_TIMEOUT
DNS query timeout in seconds
Authentication:
-u, --username USERNAME [USERNAME ...]
username(s) or file(s) containing usernames
-p, --password PASSWORD [PASSWORD ...]
password(s) or file(s) containing passwords
-id CRED_ID [CRED_ID ...]
database credential ID(s) to use for authentication
--ignore-pw-decoding Ignore non UTF-8 characters when decoding the password file
--no-bruteforce No spray when using file for username and password (user1 => password1, user2 => password2)
--continue-on-success
continues authentication attempts even after successes
--gfail-limit LIMIT max number of global failed login attempts
--ufail-limit LIMIT max number of failed login attempts per username
--fail-limit LIMIT max number of failed login attempts per host
Kerberos Authentication:
-k, --kerberos Use Kerberos authentication
--use-kcache Use Kerberos authentication from ccache file (KRB5CCNAME)
--aesKey AESKEY [AESKEY ...]
AES key to use for Kerberos Authentication (128 or 256 bits)
--kdcHost KDCHOST FQDN of the domain controller. If omitted it will use the domain part (FQDN) specified in the target parameter
Certificate Authentication:
--pfx-cert PFXCERT Use certificate authentication from pfx file .pfx
--pfx-base64 PFXB64 Use certificate authentication from pfx file encoded in base64
--pfx-pass PFXPASS Password of the pfx certificate
--pem-cert PEMCERT Use certificate authentication from PEM file
--pem-key PEMKEY Private key for the PEM format
Modules:
-M, --module MODULE module to use
-o MODULE_OPTION [MODULE_OPTION ...]
module options
-L, --list-modules [LIST_MODULES]
list available modules
--options display module options
Credential Gathering:
--list-snapshots [LIST_SNAPSHOTS]
Lists the VSS snapshots (default: ADMIN$)
Mapping/Enumeration:
--wmi-query QUERY Issues the specified WMI query
--wmi-namespace NAMESPACE
WMI Namespace (default: root\cimv2)
Command Execution:
--no-output do not retrieve command output
-x COMMAND Creates a new cmd process and executes the specified command with output
-X COMMAND Creates a new PowerShell process and executes the specified command with output
--exec-method {wmiexec,wmiexec-event}
method to execute the command. (default: wmiexec). [wmiexec (win32_process + StdRegProv)]: get command results over registry instead of using smb connection. [wmiexec-event
(T1546.003)]: this method is not very stable, highly recommend use this method in single host, using on multiple hosts may crash (just try again if it crashed).
--exec-timeout exec_timeout
Set timeout (in seconds) when executing a command, minimum 5 seconds is recommended. Default: 2
--codec CODEC Set encoding used (codec) from the target's output (default: utf-8). If errors are detected, run chcp.com at the target & map the result with
https://docs.python.org/3/library/codecs.html#standard-encodings and then execute again with --codec and the corresponding codecModules
LOW PRIVILEGE MODULES
LOW PRIVILEGE MODULES
ENUMERATION
[*] ioxidresolver This module helps you to identify hosts that have additional active interfaces
[*] spooler Detect if print spooler is enabled or not
[*] zerologon Module to check if the DC is vulnerable to Zerologon aka CVE-2020-1472
HIGH PRIVILEGE MODULES (requires admin privs)
ENUMERATION
[*] bitlocker Enumerating BitLocker Status on target(s) If it is enabled or disabled.
[*] enum_dns Uses WMI to dump DNS from an AD DNS Server
[*] get_netconnections Uses WMI to query network connections.
CREDENTIAL_DUMPING
[*] ntds-dump-raw Extracting the ntds.dit, SAM, and SYSTEM files from DC by accessing the raw hard drive.
PRIVILEGE_ESCALATION
[*] rdp Enables/Disables RDP