This hunt targets macOS systems exhibiting the specific network callback behavior of the TinyShell malware, which establishes persistent back-connect channels to command and control servers. Proactively hunting for this signature in Azure Sentinel is critical because early detection of these low-severity connections can prevent lateral movement and data exfiltration before the malware escalates its activities within the endpoint environment.
rule MALW_TinyShell_backconnect_OSX {
meta:
date = "2018-02-10"
author = "@unixfreaxjp"
condition:
is__osx
and priv01
and priv02
and priv03
and priv04
and filesize < 100KB
}
This YARA rule can be deployed in the following contexts:
Here are 4 specific false positive scenarios for the MALW TinyShell backconnect OSX detection rule in an enterprise environment, along with suggested filters or exclusions:
Scenario: Automated macOS Software Updates via MDM Push
tiny_shell or similar lightweight interpreters that initiate outbound HTTPS connections to Apple’s update servers (updates.apple.com) or the MDM cloud controller./System/Library/CoreServices/SoftwareUpdateAgent.app) OR the destination IP belongs to the verified Apple Update CIDR range, provided the connection occurs during standard maintenance windows (e.g., 02:00–06:00 local time).Scenario: Scheduled Log Rotation and Archiving Jobs
cron jobs or LaunchAgents that execute a custom shell script to compress logs (using tar/gzip) and upload them to an internal SIEM collector, Azure Blob Storage, or AWS S3 bucket via curl or wget. These scripts often run as the _system user using a minimal shell environment./Library/LaunchDaemons/com.company.logrotate.plist) targeting internal IP ranges associated with the organization’s SIEM or storage infrastructure, specifically filtering for HTTP/HTTPS protocols on ports 443 and 80.Scenario: Third-Party Endpoint Security Agent Communication