T1059: Command and Scripting Interpreter
Tactics: Execution. Platforms: Containers, ESXi, IaaS, Identity Provider, Linux, macOS, Network Devices, Office Suite, SaaS, Windows.
Abusing built-in interpreters (PowerShell, cmd, bash, WScript) to execute commands and scripts directly on a host.
Why it matters
It underlies most living-off-the-land activity; command-line and script-block logging turn these interpreters from blind spots into rich telemetry.
In practice
A single PowerShell one-liner downloads and executes a payload entirely in memory.
MITRE's description
Adversaries may abuse command and script interpreters to execute commands, scripts, or binaries. These interfaces and languages provide ways of interacting with computer systems and are a common feature across many different platforms. Most systems come with some built-in command-line interface and scripting capabilities, for example, macOS and Linux distributions include some flavor of Unix Shell while Windows installations include the Windows Command Shell and PowerShell.
Telemetry that detects it
- Command Execution
- Process Creation
- User Account Authentication
Mitigations
- Restrict Web-Based Content
- Script blocking extensions can help prevent the execution of scripts and HTA files that may commonly be used during the exploitation process.
- Limit Software Installation
- Prevent user installation of unrequired command and scripting interpreters.
- Execution Prevention
- Use application control where appropriate. For example, PowerShell Constrained Language mode can be used to restrict access to sensitive or otherwise dangerous language elements…
- Code Signing
- Where possible, only permit execution of signed scripts.
- Behavior Prevention on Endpoint
- On Windows 10, enable Attack Surface Reduction (ASR) rules to prevent Visual Basic and JavaScript scripts from executing potentially malicious downloaded content .
D3FEND countermeasures
- D3-CF: Content Filtering (Isolate)
- D3-CM: Content Modification (Isolate)
- D3-CQ: Content Quarantine (Isolate)
- D3-DA: Dynamic Analysis (Detect)
- D3-DF: Decoy File (Deceive)
- D3-EAL: Executable Allowlisting (Isolate)
- D3-EDL: Executable Denylisting (Isolate)
- D3-EFA: Emulated File Analysis (Detect)
- D3-FA: File Analysis (Detect)
- D3-FE: File Encryption (Harden)
- D3-FEV: File Eviction (Evict)
- D3-FIM: File Integrity Monitoring (Detect)
- D3-LFP: Local File Permissions (Isolate)
- D3-RF: Restore File (Restore)
- D3-RFAM: Remote File Access Mediation (Isolate)
Groups documented using it
Dragonfly, FIN6, Stealth Falcon, FIN7, FIN5, APT37, APT19, Whitefly, Windigo, Saint Bear, Winter Vivern
Procedure examples
- APT19 downloaded and launched code within a SCT file.
- APT32 has used COM scriptlets to download Cobalt Strike beacons.
- APT37 has used Ruby scripts to execute payloads.
- APT39 has utilized custom scripts to perform internal reconnaissance.
44 documented uses in all. These are a sample.
MITRE ATT&CK Enterprise 19.2. © 2026 The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation.