kevmap

TechniquesT1059.004 › AN1082

AN1082 Analytic 1082

macOS · attack.mitre.org · ATT&CK Enterprise v19.2

<p>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.</p>
Detects
T1059.004 Unix Shell
Part of
DET0384 Behavioral Detection of Unix Shell Execution

Log sources and channels

Exactly as MITRE states them in x_mitre_log_source_references. Where a channel is vague, it is vague in the source; kevmap does not tidy it.

Log sourceChannelData component
macos:unifiedloglog stream --predicate 'eventMessage contains "exec"'DC0032 Process Creation
macos:osquerylaunchd + process_eventsDC0064 Command Execution
macos:syslogsystem.log, asl.logDC0029 Script Execution

Mutable elements

Parameters MITRE marks as environment-specific. These are the knobs you are expected to tune; they are why an analytic is not a rule.

FieldDescription
ScriptLocationExecution from /Users/Shared, ~/Library/LaunchAgents, /tmp.
ParentProcessShells spawned from Preview, Safari, or AppleScript.
UserRoleDetection thresholds may differ for admin vs standard users.

KEV CVEs whose mapped technique this analytic detects

CVEVendor / productState
CVE-2014-6271GNU Bourne-Again Shell (Bash)Mapped
CVE-2014-7169GNU Bourne-Again Shell (Bash)Mapped
CVE-2016-10033PHP PHPMailerMapped
CVE-2019-0708Microsoft Remote Desktop ServicesMapped
CVE-2021-36380Sunhillo SureLineMapped
CVE-2022-20699Cisco Small Business RV160, RV260, RV340, and RV345 Series RoutersMapped
CVE-2022-20700Cisco Small Business RV160, RV260, RV340, and RV345 Series RoutersMapped
CVE-2023-38831RARLAB WinRARMapped
CVE-2023-39780ASUS RT-AX55 RoutersMapped
CVE-2023-44221SonicWall SMA100 AppliancesMapped
CVE-2023-46604Apache ActiveMQMapped
CVE-2024-24919Check Point Quantum Security GatewaysMapped
CVE-2024-27443Synacor Zimbra Collaboration Suite (ZCS)Mapped
CVE-2025-25257Fortinet FortiWebMapped