Skip to content
Threat Feed
medium advisory

Unusual Parent Process for cmd.exe

The detection rule identifies cmd.exe instances spawned by uncommon parent processes, such as lsass.exe, csrss.exe, or regsvr32.exe, which may indicate unauthorized or suspicious activity, thus aiding in early threat detection.

This detection rule identifies unusual parent processes spawning cmd.exe on Windows systems. While cmd.exe is a legitimate command-line interpreter, adversaries can exploit it by launching it from atypical parent processes to execute malicious commands stealthily. The rule focuses on identifying cmd.exe instances spawned by uncommon parent processes like lsass.exe, csrss.exe, and regsvr32.exe, which may indicate unauthorized or suspicious activity. The rule is based on the EQL query language and is designed for data generated by Elastic Defend, Microsoft Defender XDR, and SentinelOne Cloud Funnel, as well as Sysmon event logs. This detection helps in early threat detection by flagging anomalies in process relationships.

Attack Chain

  1. An attacker gains initial access to the system (e.g., through phishing or exploiting a vulnerability).
  2. The attacker executes a malicious payload on the system.
  3. The malicious payload spawns cmd.exe to execute commands.
  4. The cmd.exe process is launched by an unusual parent process, such as lsass.exe or csrss.exe, instead of typical processes like explorer.exe or cmd.exe.
  5. The cmd.exe process executes malicious commands, such as downloading additional payloads, modifying system configurations, or exfiltrating data.
  6. The attacker uses the cmd.exe process to establish persistence on the system by creating scheduled tasks or modifying registry keys.
  7. The attacker performs lateral movement by using cmd.exe to access other systems on the network.
  8. The attacker achieves their final objective, such as data theft, system compromise, or ransomware deployment.

Impact

A successful attack leveraging an unusual parent process for cmd.exe can lead to a range of adverse outcomes, including system compromise, data theft, and ransomware deployment. The impact can vary depending on the attacker’s objectives and the level of access they gain. Without proper detection and response, organizations can suffer financial losses, reputational damage, and operational disruption. The severity is dependent on the specific commands executed via the spawned command prompt.

Recommendation

  • Deploy the provided EQL query to your Elastic Security environment to detect unusual parent processes for cmd.exe.
  • Enable Sysmon process creation logging (Event ID 1) to capture the necessary data for this detection and ensure proper configuration.
  • Tune the EQL query for your environment by excluding legitimate parent processes, identified in the “False positive analysis” section, that may trigger false positives (e.g., SearchIndexer.exe, WUDFHost.exe).
  • Investigate any alerts generated by this rule to determine the nature of the malicious activity and the extent of the compromise.
  • Implement enhanced monitoring and logging for cmd.exe and its parent processes to detect similar anomalies in the future.
  • Consider deploying endpoint detection and response (EDR) solutions like Elastic Defend, Microsoft Defender XDR, or SentinelOne Cloud Funnel for enhanced visibility and protection.

Detection coverage 2

Unusual Parent Process for cmd.exe - Sysmon

medium

Detects cmd.exe spawned by unusual parent processes based on Sysmon event ID 1 (Process Creation).

sigma tactics: execution techniques: T1059.004 sources: process_creation, windows

Unusual Parent Process for cmd.exe - Process Creation

medium

Detects cmd.exe spawned by unusual parent processes based on process creation logs.

sigma tactics: execution techniques: T1059.004 sources: process_creation, windows

Detection queries are kept inside the platform. Get full rules →