MITRE ATT&CK / Techniques / T1059.004

Command and Scripting Interpreter: Unix Shell

ID
T1059.004
Tactics
TA0002 Execution
Sub-technique of
T1059 Command and Scripting Interpreter
Platforms
ESXi, Linux, macOS, Network Devices
Data sources
Process Creation, Network Traffic Flow, Logon Session Creation, Command Execution, Script Execution, Network Connection Creation
Source
attack.mitre.org
MITRE last modified
12 May 2026

Adversaries may abuse Unix shell commands and scripts for execution. Unix shells are the primary command prompt on Linux, macOS, and ESXi systems, though many variations of the Unix shell exist (e.g. sh, ash, bash, zsh, etc.) depending on the specific OS or distribution.[2][3] Unix shells can control every aspect of a system, with certain commands requiring elevated privileges.

Unix shells also support scripts that enable sequential execution of commands as well as other typical programming operations such as conditionals and loops. Common uses of shell scripts include long or repetitive tasks, or the need to run the same set of commands on multiple systems.

Adversaries may abuse Unix shells to execute various commands or payloads. Interactive shells may be accessed through command and control channels or during lateral movement such as with SSH. Adversaries may also leverage shell scripts to deliver and execute multiple commands on victims or as part of payloads used for persistence.

Some systems, such as embedded devices, lightweight Linux distributions, and ESXi servers, may leverage stripped-down Unix shells via Busybox, a small executable that contains a variety of tools, including a simple shell.

Detection

Mitigations (1)

M1038 Execution Prevention

Use application control where appropriate. On ESXi hosts, the execInstalledOnly feature prevents binaries from being run unless they have been packaged and signed as part of a vSphere installation bundle (VIB).[1]

Groups (13)

Software (50)

References

  1. Google Cloud Threat Intelligence ESXi Hardening 2023
  2. DieNet Bash
  3. Apple ZShell