| name | T1059.003_windows-command-shell |
| description | Adversaries may abuse the Windows command shell for execution. |
| category | input-validation |
| version | 18.1 |
| author | cyberstrike-official |
| tags | ["mitre-attack","enterprise","t1059.003","execution","windows","sub-technique"] |
| technique_id | T1059.003 |
| tactic | execution |
| all_tactics | ["execution"] |
| platforms | ["Windows"] |
| mitre_url | https://attack.mitre.org/techniques/T1059/003 |
| tech_stack | ["windows"] |
| cwe_ids | ["CWE-94"] |
| chains_with | ["T1059","T1059.001","T1059.002","T1059.004","T1059.005","T1059.006","T1059.007","T1059.008","T1059.009","T1059.010","T1059.011","T1059.012","T1059.013"] |
| prerequisites | ["T1059"] |
| severity_boost | {"T1059":"Chain with T1059 for deeper attack path","T1059.001":"Chain with T1059.001 for deeper attack path","T1059.002":"Chain with T1059.002 for deeper attack path"} |
T1059.003 Windows Command Shell
Sub-technique of: T1059
High-Level 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.
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.
Kill Chain Phase
Platforms: Windows
What to Check
How to Test
Atomic Red Team Tests
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Atomic Test 1: Create and Execute Batch Script
Creates and executes a simple batch script. Upon execution, CMD will briefly launch to run the batch script then close again.
Supported Platforms: windows
Start-Process "#{script_path}"
Dependencies:
- Batch file must exist on disk at specified location (#{script_path})
Atomic Test 2: Writes text to a file and displays it.
Writes text to a file and display the results. This test is intended to emulate the dropping of a malicious file to disk.
Supported Platforms: windows
echo "#{message}" > "#{file_contents_path}" & type "#{file_contents_path}"