Has used cmd.exe for malware execution, file discovery, and manual file manipulation.1233
Windows Command Shell T1059.003
- Tactic
- Execution
- Platform
- Windows
- Version
- 1.5
- Created
- 09 March 2020
- Last modified
- 12 May 2026
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.[1]
Windows Command Shell MITRE reference T1059.003
73 groups have been recorded using this technique. Newest first; each entry carries MITRE’s procedure text and a link to the group’s full record. Click a name to filter the rules below.
Has utilized VBS scripts to open cmd.exe and run commands to include the go_batch.bat batch file.1
Has used Windows Command Prompt to control and execute commands on the system to include ingress, network, and filesystem enumeration activities.1
Has executed Windows commands on guest virtual machines through vmtoolsd.exe.1
Has used multiple batch scripts during initial access and subsequent actions on victim machines.12
Executed ransomware using the Windows command shell.1
All 73 groups for this technique · 6 newest in this preview
18 campaigns have been recorded using this technique. Listed newest first; dates are year-granularity and attribution is MITRE’s.
During SharePoint ToolShell Exploitation, threat actors utilized cmd.exe and batch scripts within the victim environment.1234
During the 2025 Poland Wiper Attacks, the adversaries leveraged PsExec to run cmd.exe commands on multiple victim machines.1
During Operation Digital Eye, threat actors used cmd.exe as a default method of execution for a custom version of Mimikatz named bK2o.exe.1
Installation via JavaScript will launch follow-on commands via cmd.exe.1
During APT28 Nearest Neighbor Campaign, APT28 used cmd.exe for execution.1
During C0015, the threat actors used cmd.exe to execute commands and run malicious binaries.1
All 18 campaigns for this technique · 6 newest in this preview
295 software entries are documented implementing this technique. MITRE files each as a tool or as malware; newest first, then by how many groups carry them.
Can use cmd.exe to display a decoy file to spearphishing victims.1
Has used cmd.exe to launch a reverse shell.1
Has used the Windows command shell to execute malicious files.1
Can use the reg add command via cmd.exe for Registry modification.1
Has the ability to generate a reverse shell using the command conn <IP_ADDRESS> <PORT>.1
Can execute a disk partition script file, which attempts to mount a virtual hard disk.1 Diskpart can also assign and mount virtual disks.1
All 295 software entries for this technique · 6 newest in this preview
Offense vs defense T1059.003
Is defensive coverage keeping up with adversary use? Eight counts, each ranked against all 697 ATT&CK techniques. Attack sits left, defense right, so a shape leaning left means adversaries are better documented here than defenders are equipped. Hover any spoke for its percentile and the share of techniques that have more. The timeline below shows when each side arrived.
How it got here
Adversary activity (campaign spans) over cumulative rule output. Each source is plotted independently from zero, so neither line includes the other. Campaign dates are year-granularity.
Windows Command Shell detection strategy DET0202
MITRE names one behaviour worth catching for this technique and breaks it into 1 analytic, one per platform. Each carries the log sources it needs and the fields you tune per environment.
Behavioral Detection of Windows Command Shell Execution
AN0578 · Windows
Detects interactive or scripted abuse of cmd.exe, batch files, or shell invocation chains. Focuses on parent-child relationships (e.g., cmd.exe launched from unusual parents), anomalous command-line parameters, and chaining with discovery, credential access, or lateral movement behaviors.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Module LoadDC0016 | WinEventLog:Sysmon | EventCode=7 |
| Script ExecutionDC0029 | EDR:scriptblock | Process Tree + Script Block Logging |
| Process CreationDC0032 | WinEventLog:Security | EventCode=4688 |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| ParentProcessName | Cmd.exe launched from uncommon parents (e.g., msedge.exe, winword.exe) may indicate abuse. |
| TimeWindow | Cmd or .bat execution during non-working hours may indicate automation or C2 activity. |
| CommandLinePattern | Flags suspicious switches (e.g., /c ping, /k whoami) or command chaining (&&, ^). |
| ScriptStoragePath | Batch file execution from %TEMP%, C:\Users\Public, or external drives. |
| UserContext | Flags admin-level users executing cmd outside expected baselines. |
The Windows Command Prompt (cmd.exe) is a utility that provides a command line interface to Windows operating systems. It provides the ability to run additional programs and also has several built-in commands such as dir, copy, mkdir, and type, as well as batch scripts (.bat). Typically, when a user runs a command prompt, the parent process is explorer.exe or another instance of the prompt. There may be automated programs, logon scripts, or administrative tools that launch instances of the command prompt in order to run scripts or other built-in commands. Spawning the process cmd.exe from certain parents may be more indicative of malice. For example, if Adobe Reader or Outlook launches a command shell, this may suggest that a malicious document has been loaded and should be investigated. Thus, by looking for abnormal parent processes of cmd.exe, it may be possible to detect adversaries.
D3FEND techniques
The defensive countermeasure this analytic implements, in MITRE’s D3FEND ontology.
| ID | Name |
|---|---|
| D3-PLA | Process Lineage Analysis |
Data model references
The CAR data model objects, actions and fields the logic reads. Map these to your own schema before implementing.
| Object | Action | Field |
|---|---|---|
| process | create | exe |
| process | create | parent_exe |
Implementations
Pseudocode is the canonical logic; the rest are CAR’s translations into vendor query languages.
process = search Process:Create cmd = filter process where (exe == "cmd.exe") output cmd
DNIF version of the above pseudocode.
_fetch * from event where $LogName=WINDOWS-SYSMON AND $EventID=1 AND $Process=regex(.*cmd\.exe.*)i limit 100
LogPoint version of the above pseudocode.
norm_id=WindowsSysmon event_id=1 image="*\cmd.exe"
Unit tests
CAR’s own validation procedures for this analytic.
Within a command prompt or powershell, run cmd.exe
Many programs create command prompts as part of their normal operation including malware used by attackers. This analytic attempts to identify suspicious programs spawning cmd.exe by looking for programs that do not normally create cmd.exe.
D3FEND techniques
The defensive countermeasure this analytic implements, in MITRE’s D3FEND ontology.
| ID | Name |
|---|---|
| D3-PLA | Process Lineage Analysis |
Data model references
The CAR data model objects, actions and fields the logic reads. Map these to your own schema before implementing.
| Object | Action | Field |
|---|---|---|
| process | create | exe |
| process | create | parent_exe |
Implementations
Pseudocode is the canonical logic; the rest are CAR’s translations into vendor query languages.
Create a baseline of parents of cmd.exe seen over the last 30 days and a list of parents of cmd.exe seen today. Remove parents in the baseline from parents seen today, leaving a list of new parents.
processes = search Process:Create cmd = filter processes where (exe == "cmd.exe") cmd = from cmd select parent_exe historic_cmd = filter cmd (where timestamp < now - 1 day AND timestamp > now - 1 day) current_cmd = filter cmd (where timestamp >= now - 1 day) new_cmd = historic_cmd - current_cmd output new_cmd
Use application control where appropriate.
Tests from Atomic Red Team (MIT licence) · technique definition