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.[1][2] 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.
| ID | Name | Description |
|---|---|---|
| S0504 | Anchor | |
| S0584 | AppleJeus |
AppleJeus has used shell scripts to execute commands after installation and set persistence mechanisms.[4][5] |
| G0096 | APT41 |
APT41 used Linux shell commands for system survey and information gathering prior to exploitation of vulnerabilities such as CVE-2019-19871.[6] |
| G0143 | Aquatic Panda |
Aquatic Panda used malicious shell scripts in Linux environments following access via SSH to install Linux versions of Winnti malware.[7] |
| S1184 | BOLDMOVE | |
| S1161 | BPFDoor |
BPFDoor can create a reverse shell and supports vt100 emulator formatting.[9] |
| S0482 | Bundlore |
Bundlore has leveraged /bin/sh and /bin/bash to execute commands on the victim machine.[10] |
| S0077 | CallMe |
CallMe has the capability to create a reverse shell on victims.[11] |
| S1224 | CASTLETAP |
CASTLETAP has the ability to spawn BusyBox command shell in victim environments.[12] |
| S0220 | Chaos |
Chaos provides a reverse shell connection on 8338/TCP, encrypted via AES.[13] |
| S1105 | COATHANGER |
COATHANGER provides a BusyBox reverse shell for command and control.[14] |
| S0369 | CoinTicker |
CoinTicker executes a bash script to establish a reverse shell.[15] |
| G1052 | Contagious Interview |
Contagious Interview has targeted macOS victim hosts using a bash downloader coremedia.sh and a bash script cloud.sh.[16] |
| S0492 | CookieMiner |
CookieMiner has used a Unix shell script to run a series of commands targeting macOS.[17] |
| S1153 | Cuckoo Stealer |
Cuckoo Stealer can spawn a bash shell to enable execution on compromised hosts.[18] |
| S0021 | Derusbi |
Derusbi is capable of creating a remote Bash shell and executing commands.[19][20] |
| S0600 | Doki | |
| S0502 | Drovorub |
Drovorub can execute arbitrary commands as root on a compromised system.[22] |
| S0377 | Ebury |
Ebury can use the commands |
| S0401 | Exaramel for Linux |
Exaramel for Linux has a command to execute a shell command on the system.[24][25] |
| C0053 | FLORAHOX Activity |
FLORAHOX Activity has executed multiple Bash controller scripts to provide command line inputs for FLORAHOX traversal configurations.[26] |
| S0410 | Fysbis |
Fysbis has the ability to create and execute commands in a remote shell for CLI.[27] |
| S1198 | Gomir |
Gomir reads command line arguments and parses them for functionality when executed from a Linux shell, and can execute arbitrary strings passed to it as shell commands.[28] |
| S0690 | Green Lambert |
Green Lambert can use shell scripts for execution, such as |
| S0601 | Hildegard | |
| S1203 | J-magic |
The J-magic agent is executed through a command line argument which specifies an interface and listening port.[32] |
| S0265 | Kazuar |
Kazuar uses /bin/bash to execute commands on the victim’s machine.[33] |
| S0599 | Kinsing |
Kinsing has used Unix shell scripts to execute commands in the victim environment.[34] |
| S0641 | Kobalos |
Kobalos can spawn a new pseudo-terminal and execute arbitrary commands at the command prompt.[35] |
| C0035 | KV Botnet Activity |
KV Botnet Activity utilizes multiple Bash scripts during botnet installation stages, and the final botnet payload allows for running commands in the Bash shell.[36] |
| S0451 | LoudMiner |
LoudMiner used shell scripts to launch various services and to start/stop the QEMU virtualization.[37] |
| S1016 | MacMa |
MacMa can execute supplied shell commands and uses bash scripts to perform additional actions.[38][39] |
| S0198 | NETWIRE |
NETWIRE has the ability to use |
| S1107 | NKAbuse |
NKAbuse is initially installed and executed through an initial shell script.[42] |
| C0048 | Operation MidnightEclipse |
During Operation MidnightEclipse, threat actors piped output from stdout to bash for execution.[43][44] |
| S0402 | OSX/Shlayer |
OSX/Shlayer can use bash scripts to check the macOS version, download payloads, and extract bytes from files. OSX/Shlayer uses the command |
| S0352 | OSX_OCEANLOTUS.D |
OSX_OCEANLOTUS.D uses a shell script as the main executable inside an app bundle and drops an embedded base64-encoded payload to the |
| S1109 | PACEMAKER | |
| S0587 | Penquin | |
| S1123 | PITSTOP |
PITSTOP has the ability to receive shell commands over a Unix domain socket.[53] |
| S0279 | Proton |
Proton uses macOS' .command file type to script actions.[54] |
| S1108 | PULSECHECK |
PULSECHECK can use Unix shell script for command execution.[51] |
| C0055 | Quad7 Activity |
Quad7 Activity has enabled the creation of an access-controlled command shell |
| C0056 | RedPenguin |
During RedPenguin, UNC3886 used malware capable of launching an interactive shell.[57][58] |
| S1219 | REPTILE |
REPTILE can deploy components automatically with shell scripts.[59] |
| S1222 | RIFLESPINE |
RIFLESPINE can execute commands with |
| G0106 | Rocke |
Rocke used shell scripts to run commands which would obtain persistence and execute the cryptocurrency mining malware.[60] |
| G1015 | Scattered Spider |
Scattered Spider has used the command shell to upload and install the Teleport remote access tool to a compromised vCenter Server Appliance.[61] |
| G1041 | Sea Turtle |
Sea Turtle used shell scripts for post-exploitation execution in victim environments.[62][63] |
| S0468 | Skidmap |
Skidmap has used |
| S1163 | SnappyTCP |
SnappyTCP creates the reverse shell using a pthread spawning a bash shell.[62] |
| G0139 | TeamTNT | |
| S0647 | Turian |
Turian has the ability to use |
| G1048 | UNC3886 |
UNC3886 has used a bash script to install malicious vSphere Installation Bundles (VIBs).[68] |
| G1047 | Velvet Ant |
Velvet Ant used a custom tool, VELVETSTING, to parse encoded inbound commands to compromised F5 BIG-IP devices and then execute them via the Unix shell.[69] |
| S1217 | VIRTUALPITA |
VIRTUALPITA has the ability to spawn a bash shell for script execution.[68] |
| G1017 | Volt Typhoon |
Volt Typhoon has used Brightmetricagent.exe which contains a command- line interface (CLI) library that can leverage command shells including Z Shell (zsh).[70] |
| S0466 | WindTail |
WindTail can use the |
| S0658 | XCSSET |
XCSSET uses a shell script to execute Mach-o files and |
| S1114 | ZIPLINE |
ZIPLINE can use |
| ID | Mitigation | Description |
|---|---|---|
| M1038 | Execution Prevention |
Use application control where appropriate. On ESXi hosts, the |
| ID | Name | Analytic ID | Analytic Description |
|---|---|---|---|
| DET0384 | Behavioral Detection of Unix Shell Execution | AN1081 |
Detects bash, sh, zsh, or BusyBox shell execution initiated via remote sessions, unauthorized users, or embedded within secondary script interpreters. Focus is on chained behavior: shell > suspicious commands > network discovery or persistence indicators. |
| AN1082 |
Identifies use of sh/bash/zsh in suspicious context, such as user scripts launched from non-standard apps (e.g., Preview.app), embedded in LaunchDaemons, or executed outside Terminal.app. Looks for misuse in Automator, LaunchAgents, or NSAppleScript-executed shell. |
||
| AN1083 |
Detects BusyBox or Ash shell execution from unauthorized logins or remote connections. Focus is on rare shell invocations from DCUI, SSH sessions, or remote management paths. Also watches for payload droppers or persistence artifacts using shell. |
||
| AN1084 |
Detects Unix shell usage on network appliances (e.g., routers, firewalls, embedded Linux) through rare console commands, CLI interfaces, or script injection via exposed APIs or SSH. |