Service Reconnaissance via WMIC.exe
Adversaries use WMIC.exe to enumerate running services on remote devices, potentially identifying valuable targets or misconfigured systems.
Attackers may leverage the Windows Management Instrumentation Command-line (WMIC) tool for reconnaissance activities within a network. Specifically, WMIC can be used to query and retrieve information about services running on remote systems. By executing WMIC commands with the ‘service’ parameter, adversaries can identify the presence and status of specific services, potentially revealing vulnerable or misconfigured systems. This information can then be used to guide further exploitation attempts. WMIC is a built-in Windows utility, making its activity blend with legitimate system administration tasks, increasing the difficulty of detection. This activity is a component of the broader T1047 technique (Windows Management Instrumentation).
Attack Chain
- The attacker gains initial access to a compromised system within the target network.
- The attacker executes WMIC.exe from the command line.
- WMIC.exe is invoked with the
serviceparameter to query service information. - The command includes a target IP address or hostname to query a remote system.
- The command attempts to retrieve service names and status information (e.g.,
wmic /node:"192.168.1.100" service get name, state). - WMIC attempts to connect to the remote host via RPC. An error message is generated if the remote host is unreachable: “Node - (provided IP or default) ERROR Description =The RPC server is unavailable”.
- If the target service is not running, a “No instance(s) Available” message may be displayed.
- The attacker parses the output from WMIC to identify running services of interest for further exploitation or lateral movement.
Impact
Successful service reconnaissance allows attackers to map potential attack vectors within a network. By identifying specific services running on remote systems, attackers can prioritize targets for exploitation based on known vulnerabilities or misconfigurations. This can lead to unauthorized access, data breaches, and system compromise. While the reconnaissance itself does not directly cause harm, it provides crucial information that enables subsequent malicious activities.
Recommendation
- Deploy the Sigma rule
Detect Suspicious WMIC Service Enumerationto your SIEM to identify potential service reconnaissance attempts via WMIC (logsource: process_creation, product: windows). - Monitor process creation events for
WMIC.exeexecutions containing theserviceparameter using endpoint detection and response (EDR) solutions (logsource: process_creation, product: windows). - Implement network segmentation to limit the scope of potential reconnaissance activities.
- Review and restrict the use of WMIC in your environment, as it is a common tool for both legitimate administration and malicious activity.
Detection coverage 2
Detect Suspicious WMIC Service Enumeration
mediumDetects the execution of wmic.exe to enumerate services on remote hosts
WMIC Reconnaissance with Specific Service Query
mediumDetects wmic.exe being used to specifically query for a service.
Detection queries are kept inside the platform. Get full rules →