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
- Attacker gains initial access and establishes a presence on a compromised host.
- Attacker deploys CrackMapExec to enumerate network segments or target specific domain controllers.
- Attacker uses the SMB or WMI module within CME to trigger remote command execution on a target system.
- CME executes commands via 'cmd.exe' using standardized redirection syntax to capture output into temporary files or administrative shares.
- Attacker executes PowerShell scripts via CME, typically using 'bypass', 'noni', and 'nop' flags to circumvent execution policies.
- PowerShell commands are often obfuscated or encoded via 'enc' parameters to minimize detection footprint.
- 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
Mitigations
Restrict usage of administrative shares and restrict PowerShell execution policy
Lateral movement TTPs
Detection coverage 1
Detect CrackMapExec Execution Patterns
highDetects various command-line execution patterns used by the CrackMapExec pentesting framework
Detection queries are available on the platform. Get full rules →