Execution · ATT&CK v20
T1059.004 Command and Scripting Interpreter: Unix Shell
A Execution technique. Running the attacker’s code on a system.
- T1059.004Technique ID
- ExecutionTactic
- 5Places taught
What the attacker does
The attacker runs commands through a Unix shell (bash, sh, zsh) on a Linux or macOS host, often as a one-line download-and-run.
How it shows up in the logs
- auditd execve records or EDR process events for bash -c, sh -c, curl | sh, wget -O- | bash.
- A shell started by a service process (a web server, a database) instead of a user's SSH session.
- Shell history files, if they were not cleared.
Questions to ask in triage
- What started the shell, and as which user?
- What did it download, and from where?
- What did it change on the system?
Read T1059.004 on attack.mitre.org
A sub-technique of T1059.
Where you meet it in CyberSim
In the detection lab
Write the rule yourself.
- Linux web server spawning a shell or downloader
In the theory
In the hands-on labs
A simulated machine in your browser.
In the cases
Part of the answer in 2 investigations, in these learning paths:
Which case is not said here: finding it is the case.
More Execution techniques
- T1047 Windows Management Instrumentation
- T1059.001 Command and Scripting Interpreter: PowerShell
- T1059.007 Command and Scripting Interpreter: JavaScript
- T1072 Software Deployment Tools
- T1204.002 User Execution: Malicious File
- T1204.004 User Execution: Malicious Copy and Paste
- T1204.005 User Execution: Malicious Library
- T1569.002 System Services: Service Execution
- T1698 Indirect Prompt Injection
Source: MITRE ATT&CK T1059.004, tactic TA0002.