MITRE ATT&CK / Techniques / T1059

Command and Scripting Interpreter

ID
T1059
Tactics
TA0002 Execution
Platforms
Containers, ESXi, IaaS, Identity Provider, Linux, macOS, Network Devices, Office Suite, SaaS, Windows
Data sources
Process Creation, Command Execution, User Account Authentication
Source
attack.mitre.org
MITRE last modified
12 May 2026

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.

There are also cross-platform interpreters such as Python, as well as those commonly associated with client applications such as JavaScript and Visual Basic.

Adversaries may abuse these technologies in various ways as a means of executing arbitrary commands. Commands and scripts can be embedded in Initial Access payloads delivered to victims as lure documents or as secondary payloads downloaded from an existing C2. Adversaries may also execute commands through interactive terminals/shells, as well as utilize various Remote Services in order to achieve remote Execution.[5][6][7]

Sub-techniques (13)

Detection

Mitigations (9)

M1021 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. For malicious code served up through ads, adblockers can help prevent that code from executing in the first place.

M1026 Privileged Account Management

When PowerShell is necessary, consider restricting PowerShell execution policy to administrators. Be aware that there are methods of bypassing the PowerShell execution policy, depending on environment configuration.[1]

PowerShell JEA (Just Enough Administration) may also be used to sandbox administration and limit what commands admins/users can execute through remote PowerShell sessions.[2]

M1033 Limit Software Installation

Prevent user installation of unrequired command and scripting interpreters.

M1038 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 such as those used to execute arbitrary Windows APIs or files (e.g., Add-Type).[3]

M1040 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 [4].

M1042 Disable or Remove Feature or Program

Disable or remove any unnecessary or unused shells or interpreters.

M1045 Code Signing

Where possible, only permit execution of signed scripts.

M1047 Audit

Inventory systems for unauthorized command and scripting interpreter installations.

M1049 Antivirus/Antimalware

Anti-virus can be used to automatically quarantine suspicious files.

Groups (17)

Software (23)

References

  1. Netspi PowerShell Execution Policy Bypass
  2. Microsoft PS JEA
  3. Microsoft PowerShell CLM
  4. win10_asr
  5. Powershell Remote Commands
  6. Cisco IOS Software Integrity Assurance - Command History
  7. Remote Shell Execution in Python