Executive Summary
Windows Command Shell (T1059.003) is a MITRE ATT&CK technique associated with Execution. Adversaries may abuse the Windows command shell for execution.
Why Attackers Use It
Attackers use Windows Command Shell because it provides a reliable way to advance their objective within the Execution tactic, often with a favorable balance of impact versus detectability on Windows environments. Defenders should assess this behavior in the context of the affected platform and adjacent activity rather than treating it as a standalone indicator.
MITRE Description
Adversaries may abuse the Windows command shell for execution. The Windows command shell (cmd) is the primary command prompt on Windows systems. The Windows command prompt can be used to control almost any aspect of a system, with various permission levels required for different subsets of commands. The command prompt can be invoked remotely via Remote Services such as SSH.(Citation: SSH in Windows)
Batch files (ex: .bat or .cmd) also provide the shell with a list of sequential commands to run, as well as normal scripting operations such as conditionals and loops. Common uses of batch files include long or repetitive tasks, or the need to run the same set of commands on multiple systems.
Adversaries may leverage cmd to execute various commands and payloads. Common uses include cmd to execute a single command, or abusing cmd interactively with input and output forwarded over a command and control channel.
Attack Flow
- Attacker gains the prerequisite access or context described below.
- Attacker executes Windows Command Shell to achieve its tactical objective (Execution).
- Resulting access/data/effect is leveraged to advance the broader attack chain (see Related Techniques).
Prerequisites
- Platform(s): Windows
- ATT&CK does not define one universal permission requirement for this technique. Establish the required access from the observed implementation and affected platform.
Common Tools
- Tool attribution is implementation-specific. Use ATT&CK procedure examples and local telemetry to identify the binaries, services, scripts, accounts, or cloud resources involved.
Commands
No universal command represents Windows Command Shell. Capture the exact command line, arguments, parent process, account, host, and execution time from the investigated environment; do not operationalize unverified examples.
Network Traffic
- Network observability is implementation-dependent. Review DNS, proxy, firewall, flow, authentication, and packet telemetry around the activity window, then correlate remote endpoints and protocol behavior with host evidence.
Windows Events
| Event ID | Log Channel | What It Indicates |
|---|
| Environment-specific | Relevant Windows channel(s) | Correlate authentication, process, object-access, and configuration events with the observed execution context. |
Sysmon Events
| Sysmon Event ID | Name | Why It's Relevant Here |
|---|
| Environment-specific | Validate configured telemetry | Use process, network, file, registry, DNS, or image-load telemetry only when relevant and enabled. |
Detection Opportunities
No MITRE detection guidance published for this technique.
Relevant ATT&CK Data Sources: N/A
Sigma Rules
A universal Sigma rule would create unreliable results because this technique has no single guaranteed observable. Build detection logic from a documented behavior and supported data source, scope it to the affected platform, and validate it against benign administrative activity before deployment.
Splunk Queries
Start with the data sources named in the detection section. Scope searches by asset, identity, and time window; correlate the primary behavior with preceding access and subsequent actions. A portable query is intentionally not provided where the technique lacks a universal schema or observable.
Investigation Workflow
- Confirm that the observed behavior is consistent with Windows Command Shell and rule out expected administrative or application activity.
- Establish the first-seen time, initiating identity, source system, target system, and affected resources.
- Collect relevant host, identity, network, cloud, and application telemetry for the surrounding time window.
- Correlate parent and child activity, remote connections, file or configuration changes, and related ATT&CK techniques.
- Determine scope by searching for the same observable across peer assets and identities.
- Preserve volatile evidence and record confidence, assumptions, and telemetry gaps before containment.
Containment
- Isolate affected host(s)/account(s) identified during investigation.
- Revoke or rotate any credentials/tokens potentially exposed.
- Apply the mitigations listed below where not already enforced.
- Validate no related techniques (see Related Techniques) were chained against the same asset.
Mitigation
- M1038 -- Execution Prevention: Prevent the execution of unauthorized or malicious code on systems by implementing application control, script blocking, and other execution prevention mechanisms.
Related Techniques
- T1001
- T1001.003
- T1003
- T1003.001
- T1003.002
- T1005
- T1007
- T1008
- T1010
- T1012
- T1016
- T1016.001
- T1016.002
- T1018
- T1021.001
- T1021.002
- T1021.005
- T1027
- T1027.001
- T1027.002
- T1027.003
- T1027.004
- T1027.009
- T1027.010
- T1027.011
- T1027.013
- T1027.015
- T1029
- T1030
- T1033
- T1036
- T1036.001
- T1036.003
- T1036.004
- T1036.005
- T1036.008
- T1036.010
- T1037.001
- T1039
- T1041
- T1046
- T1047
- T1048
- T1049
- T1053.002
- T1053.005
- T1055
- T1055.001
- T1055.002
- T1055.004
- T1055.012
- T1056.001
- T1057
- T1059
- T1059.001
- T1059.005
- T1059.006
- T1059.011
- T1069
- T1069.001
- T1069.002
- T1070
- T1070.004
- T1070.005
- T1070.009
- T1071
- T1071.001
- T1071.002
- T1071.003
- T1071.004
- T1072
- T1074
- T1074.001
- T1074.002
- T1078
- T1078.002
- T1078.003
- T1080
- T1082
- T1083
- T1087.001
- T1087.003
- T1090
- T1090.002
- T1095
- T1098.007
- T1102.001
- T1102.002
- T1104
- T1105
- T1106
- T1110.001
- T1110.002
- T1112
- T1113
- T1114.001
- T1114.002
- T1120
- T1124
- T1125
- T1127.001
- T1132
- T1132.001
- T1132.002
- T1134
- T1134.001
- T1135
- T1136
- T1136.001
- T1137.001
- T1140
- T1190
- T1197
- T1204.002
- T1218.001
- T1218.004
- T1218.007
- T1218.008
- T1218.010
- T1218.011
- T1219
- T1219.001
- T1220
- T1222.001
- T1480.002
- T1482
- T1484.001
- T1486
- T1489
- T1490
- T1491.001
- T1497
- T1497.001
- T1497.002
- T1497.003
- T1505.003
- T1518.001
- T1531
- T1543.003
- T1546.003
- T1546.011
- T1546.015
- T1547
- T1547.001
- T1547.004
- T1547.009
- T1548.002
- T1550.002
- T1550.003
- T1553.002
- T1553.004
- T1560.001
- T1561.001
- T1561.002
- T1564
- T1564.003
- T1564.004
- T1564.005
- T1564.006
- T1566.001
- T1566.003
- T1567
- T1567.002
- T1568
- T1568.002
- T1569.002
- T1570
- T1571
- T1573.001
- T1573.002
- T1574
- T1574.001
- T1574.012
- T1583
- T1583.004
- T1585.002
- T1585.003
- T1588.001
- T1588.002
- T1588.003
- T1589.002
- T1614.001
- T1615
- T1620
- T1654
- T1657
- T1665
- T1680
- T1685
- T1685.001
- T1685.005
- T1686
- T1686.003