Skip to content
Threat Feed
low advisory

Suspicious Command Prompt Network Connection

This alert identifies suspicious network connections initiated by the command prompt (cmd.exe) when executed with arguments indicative of script execution, remote resource access, or originating from Microsoft Office applications, which is a common tactic for downloading payloads or establishing command and control.

This detection identifies suspicious network connections initiated by the command prompt (cmd.exe) on Windows systems. The rule focuses on cmd.exe processes executed with specific arguments, such as those indicating script execution (e.g., *.bat, *.cmd), access to remote resources (e.g., URLs), or those spawned by Microsoft Office applications (Excel, Word, etc.). Attackers frequently abuse cmd.exe to download malicious payloads, execute commands, or establish command and control channels. This detection aims to identify such potentially malicious activity by correlating process creation events with subsequent network connections. The rule excludes common private and reserved IP address ranges to reduce false positives. The targeted systems are Windows endpoints where adversaries attempt to leverage cmd.exe for malicious purposes.

Attack Chain

  1. A user opens a malicious document (e.g., Word, Excel) or executes a seemingly benign application.
  2. The document or application contains a macro or script that initiates a cmd.exe process.
  3. The cmd.exe process is launched with arguments indicating script execution (/c, /k) and referencing a remote resource (e.g., a URL) or a local batch file.
  4. The cmd.exe process attempts to download a payload from a remote server using protocols like HTTP, HTTPS, or FTP.
  5. The downloaded payload is saved to disk, often with a disguised filename.
  6. The cmd.exe process executes the downloaded payload, initiating further malicious actions.
  7. The malicious payload establishes a command and control (C2) channel with a remote server.
  8. The attacker uses the C2 channel to send commands to the compromised system, potentially leading to data exfiltration or other malicious activities.

Impact

Successful exploitation can lead to the compromise of Windows endpoints, potentially enabling attackers to download and execute malicious payloads, establish command and control channels, and perform further malicious activities such as data theft, lateral movement, or ransomware deployment. While this detection has a low severity, it serves as an early warning sign of potential compromise and should be investigated promptly.

Recommendation

  • Enable process creation logging with command line arguments to capture the full context of cmd.exe executions.
  • Monitor network connections from cmd.exe processes, focusing on connections to external IP addresses, using a network monitoring solution.
  • Deploy the Sigma rules provided in this brief to your SIEM to detect suspicious cmd.exe network connections.
  • Investigate any alerts generated by the Sigma rules, focusing on cmd.exe processes spawned by Office applications or those executing scripts from remote URLs.

Detection coverage 2

Detect Command Prompt Connecting to Internet with Script Execution

medium

Detects command prompt connecting to the internet while executing a script.

sigma tactics: command_and_control, execution techniques: T1059.003, T1071 sources: process_creation, windows

Detect Command Prompt Network Connection from Office Application

medium

Detects command prompt network connection spawned by Office applications.

sigma tactics: execution, initial_access techniques: T1059.003, T1566.001 sources: process_creation, windows

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