T1059.004 Unix Shell
Executionon attack.mitre.org
ATT&CK Enterprise 20.0 · 20.1 released, update in review
How MITRE detects it
DET0384 Behavioral Detection of Unix Shell Execution
AN1081 Linux
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.
| MITRE log source | In Microsoft Sentinel |
|---|---|
auditd:SYSCALLexecve | Not mapped to Sentinel yet. |
linux:osquerysocket_events | Not mapped to Sentinel yet. |
linux:syslogauth.log / secure.log | Not mapped to Sentinel yet. |
AN1082 macOS
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.
| MITRE log source | In Microsoft Sentinel |
|---|---|
macos:unifiedloglog stream --predicate 'eventMessage contains "exec"' | Not mapped to Sentinel yet. |
macos:osquerylaunchd + process_events | Not mapped to Sentinel yet. |
macos:syslogsystem.log, asl.log | Not mapped to Sentinel yet. |
AN1083 ESXi
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.
| MITRE log source | In Microsoft Sentinel |
|---|---|
esxi:vmkernelDCUI shell start, BusyBox activity | Not mapped to Sentinel yet. |
esxi:authShell login or escalation | Not mapped to Sentinel yet. |
AN1084 Network Devices
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.
| MITRE log source | In Microsoft Sentinel |
|---|---|
networkdevice:syslogCLI Command Audit | Not mapped to Sentinel yet. |
NSM:Flowremote access | Not mapped to Sentinel yet. |
Content Hub rules tagged with it (3)
- PHP Worker Process Spawning Shell/Recon Tool
- AWSCloudTrail - Lambda function code updated
- Potential Maldoc Execution Chain Observed
How the Content Hub rules for T1059.004 are built: their tables, filters, joins, schedules and windows.
In Sigma rules
19 SigmaHQ community rules name it in their tags.
- Linux Reverse Shell Indicator
- AWS EC2 Startup Shell Script Change
- Equation Group Indicators
- JexBoss Command Sequence
- Shell Invocation via Env Command - Linux
- Suspicious Activity in Shell Commands
- Suspicious Reverse Shell Command Line
- BPFtrace Unsafe Option Usage
- Interactive Bash Suspicious Children
- Nohup Execution
- Suspicious Commands Linux
- Axios NPM Compromise Indicators - Linux
- Axios NPM Compromise Indicators - macOS
- Script Interpreter Spawning Credential Scanner - Linux
- Suspicious Download and Execute Pattern via Curl/Wget
- Suspicious Filename with Embedded Base64 Commands
- Potential Abuse of Linux Magic System Request Key
- Shell Spawned by Celery Worker Process
- Potentially Suspicious Long Filename Pattern - Linux
Mitigations
MITRE ATT&CK® is a registered trademark of The MITRE Corporation. VeriKQL is not affiliated with or endorsed by MITRE. ATT&CK data © The MITRE Corporation, used under its terms of use.