Skip to content
Threat Feed
high advisory

Detection of CrackMapExec Post-Exploitation Execution Patterns

Detection engineering brief covering common command-line execution patterns generated by the CrackMapExec (CME) post-exploitation framework during lateral movement and command execution.

CrackMapExec (CME) is a widely used post-exploitation tool primarily employed by penetration testers and adversaries to assess and exploit Active Directory environments. The tool automates lateral movement and credential harvesting by leveraging native Windows protocols such as SMB, WMI, and WinRM. A key characteristic of CME is its use of specific, predictable command-line execution patterns when executing commands on remote targets. These patterns often involve redirected output via administrative shares or the invocation of PowerShell with specific evasion flags to bypass security policies. Defenders can monitor for these standardized command line arguments to identify unauthorized use of the framework within their environment.

Attack Chain

  1. Attacker gains initial access and establishes a presence on a compromised host.
  2. Attacker deploys CrackMapExec to enumerate network segments or target specific domain controllers.
  3. Attacker uses the SMB or WMI module within CME to trigger remote command execution on a target system.
  4. CME executes commands via 'cmd.exe' using standardized redirection syntax to capture output into temporary files or administrative shares.
  5. Attacker executes PowerShell scripts via CME, typically using 'bypass', 'noni', and 'nop' flags to circumvent execution policies.
  6. PowerShell commands are often obfuscated or encoded via 'enc' parameters to minimize detection footprint.
  7. Final objective is achieved, such as credential dumping (e.g., Mimikatz modules), persistence establishment, or further lateral movement.

Impact

Successful deployment of CrackMapExec by unauthorized actors can lead to rapid lateral movement, privilege escalation, and full domain compromise. The framework's ability to automate complex attacks at scale significantly increases the speed at which an environment can be compromised, often leading to large-scale data exfiltration or ransomware deployment if left undetected.

Recommendation

Prioritize the deployment of process-creation telemetry logging across all domain-joined endpoints. Enable Sysmon Event ID 1 to capture 'CommandLine' and 'ParentImage' metadata. Deploy the Sigma rules below to your SIEM/XDR platform and monitor for these specific command patterns. Because CME is commonly used in testing, triage findings by validating the source of the activity against known scheduled internal red team operations.


Immediate actions

Deploy Sigma rule for CrackMapExec patterns to SIEM

Detection Engineering 48h

Mitigations

Restrict usage of administrative shares and restrict PowerShell execution policy

medium_term IT Operations

Lateral movement TTPs

Detection coverage 1

Detect CrackMapExec Execution Patterns

high

Detects various command-line execution patterns used by the CrackMapExec pentesting framework

sigma tactics: execution, persistence, privilege-escalation techniques: T1047, T1053, T1059.001, T1059.003 sources: process_creation, windows

Detection queries are available on the platform. Get full rules →