Skip to main content
Mallory
MalwareUsed by 2 actors

Shlayer

Shlayer is a macOS malware family and trojan/downloader, first reported in February 2018, that is primarily associated with ad fraud through the installation of adware. It commonly masquerades as a legitimate installer, especially fake Adobe Flash Player updates, and is distributed via fake software update pages, malicious websites, compromised search results, low-reputation sites, malvertising, and redirect chains. Multiple reports describe it as one of the most prevalent macOS threats, with Kaspersky stating it was the most common macOS threat for nearly two years and accounted for almost 30% of its macOS detections in 2019.

Its core role is typically first-stage access: Shlayer penetrates the system, collects basic host information such as macOS version and identifiers, downloads secondary payloads, executes them, and then often removes staging artifacts. Observed variants have been implemented in bash, zsh, Python, and Mach-O forms. Reported behaviors include use of built-in macOS utilities such as curl, openssl, unzip, sqlite3, hdiutil, perl, plutil, defaults, system_profiler, xxd, mktemp, mdls, chmod, open, and killall. Several analyses note heavy obfuscation, including base64 and AES decryption, embedded encrypted ZIP content, encrypted blobs in scripts, and in one variant, AES-encrypted configuration data hidden inside a modified DMG structure between the plist and the 512-byte "koly" trailer. Shlayer has also been observed querying the LaunchServices QuarantineEventsV2 database, including checks for recent Amazon S3 download URLs, and using curl to fetch second-stage payloads in ways that can bypass Gatekeeper because curl downloads do not receive the quarantine attribute.

Shlayer is strongly associated with delivery of adware payloads, especially Bundlore, and has also been reported delivering AdLoad, Cimpli, Bnodlero, Geonei, and Pirrit. The downstream adware payloads have been described as installing malicious Safari extensions, intercepting browser searches, modifying search results for ad monetization, displaying intrusive advertisements, adding trusted certificates, and redirecting or inspecting traffic. Some campaigns also attempted to obtain the user’s password via misleading prompts. Persistence-related behavior described in the content includes installation of adware with persistence mechanisms and use of LaunchAgents in broader execution chains.

The malware’s infrastructure and delivery ecosystem have repeatedly been tied to fake Flash update campaigns, Amazon S3 and CloudFront hosting, and large-scale malvertising operations. Confiant linked Shlayer delivery to the VeryMal campaign and identified fake Flash update infrastructure on .icu domains; Confiant also described Yosec as a major distribution source for the trojan. Reported indicators and artifacts include the CloudFront domain d2hznnx43bsrxg[.]cloudfront[.]net, S3-hosted payload delivery, command-and-control domains and URLs used to retrieve ZIP payloads, and sample hashes including MD5 4d86ae25913374cfcb80a8d798b9016e, SHA-256 0fe475cc5da11e1f3ca5e0bc81d5ee406bdf4b4c428ebdab35f4dad63c0b9093, and SHA-256 063bbebb64e3b4f5f5844ca3cf46b69dc195e74a692bc9a977d35bed7edc0e3a.

The content also notes that Shlayer evolved to abuse Apple trust mechanisms: Objective-See reported it as the first malicious code notarized by Apple, and other reporting observed signed initial DMGs using legitimate Apple Developer IDs. Overall, the supporting material consistently characterizes Shlayer as a prolific macOS downloader/dropper whose main purpose is to install and launch additional adware or other malicious payloads while evading macOS protections through social engineering, obfuscation, and quarantine/Gatekeeper bypass techniques.

Share:
For your environment

Hunt this family in your stack

Mallory pivots from this family to the IOCs, detections, and named campaigns that touch your stack, and pages you when something new lands.

THREAT ACTORS

Groups observed using it

2 distinct threat actors attributed by public researchers. Open in Mallory to see the full evidence chain and overlapping campaigns.

View more details
VeryMal

The bad actor is known for running large scale fake Flash update campaigns that are hosted on .icu domains by way of display ad auto-redirects: VeryMal Fake Flash Update — Shlayer Trojan

via confiant blogblog.confiant.com
YoSec

Yosec — ... They are a major source of distribution for the notorious Shlayer trojan: OSX/Shlayer ...

via confiant blogblog.confiant.com
MITRE ATT&CK

Techniques & procedures

27 distinct techniques documented for this family, organized by ATT&CK tactic.

Resource Development

1 technique
T1583Acquire InfrastructureEvidence3

The installers are usually macOS disk image files (DMG) that are distributed via compromised Google search results or downloaded from websites with poor reputation (like cracks, keygens).

Initial Access

2 techniques
T1189Drive-by CompromiseEvidence3

On the websites, the newly minted owner posted a malicious script that redirects users to Shlayer download landing pages.

T1566.002Spearphishing LinkEvidence1

Time and again, we have uncovered links pointing to malware downloads in the descriptions of YouTube videos: Another example is links to Shlayer distribution pages contained in the footnotes to Wikipedia articles.

Execution

5 techniques
T1059Command and Scripting InterpreterEvidence1

Note the decrypted string that corresponds to commands, OSX/Shlayer.F executes them via popen() function.

T1059.004Unix ShellEvidence2

The malicious shell scripts used by Shlayer and Bundlore are usually malvertising-focused adware bundlers using shell scripts in the kill chain to download and install an adware payload.

T1059.006PythonEvidence1

However, the seemingly standard installer turns out to be a Python script, which is already atypical of macOS installation software.

T1204User ExecutionEvidence4

Upon installation, the disk image mounts thereby initiating the bash shell script installation.

T1204.002Malicious FileEvidence1

В терминологии MITRE ATT&CK задействованы User Execution: Malicious File (T1204.002, Execution ...).

Stealth

8 techniques
T1027Obfuscated Files or InformationEvidence3

The bash script in these variants decrypt the next stage encrypted blobs containing the next stage bash scripts using openssl with base64, Advanced Encryption Standard (AES), CBC (Cipher Block Chaining) to thwart security scanners.

T1027.003SteganographyEvidence1

That’s exactly what we saw with VeryMal’s offensive steganography and what we’re continuing to see with this use of harmless looking Firestore code.

T1036MasqueradingEvidence3

The bash files download the second-stage adware payload which lures the victim to generally install a fake version of flash player as shown below.

T1070.004File DeletionEvidence1

After that, the Trojan runs the downloaded and unpacked application package using the built-in open tool, and deletes the downloaded archive and its unpacked contents.

T1218System Binary Proxy ExecutionEvidence1

Most variants of them are known to commonly leverage at least 3 of the 5 built-in macOS commands and utilities: openssl, curl, sqlite3, killall and funzip.

T1497Virtualization/Sandbox EvasionEvidence3

Use mdls to validate payload download sources and timestamps to guard against sandbox executions. mdls -name "kMDItemWhereFroms" -name "kMDItemDownloadedDate"

T1497.001System ChecksEvidence2

I could also see this used as an anti-sandbox check, since sandbox analysis systems won’t have such entry in the LSQuarantineEvent table when submitting a sample for analysis.

T1564.001Hidden Files and DirectoriesEvidence1

“a .command script is executed from a hidden directory in the mounted volume… (e.g. /Volumes/Player/.hidden)”

Defense Impairment

2 techniques
T1222File and Directory Permissions ModificationEvidence1

After unpacking the archive, the main python script uses the chmod tool to assign the file 84cd5bba3870 permission to run in the system.

T1553.001Gatekeeper BypassEvidence1

В терминологии MITRE ATT&CK задействованы ... Gatekeeper Bypass (T1553.001, Defense Evasion ...).

Discovery

6 techniques
T1012Query RegistryEvidence1

encrypted string ref in function 0x100020a50 decoded to : defaults read /System/Library/CoreServices/SystemVersion.plist ProductVersion

T1082System Information DiscoveryEvidence4

mdls list file metadata across standard metadata (creation date, size), extended attribute (quarantine), and Spotlight APIs (Finder flags).

T1083File and Directory DiscoveryEvidence2

Use mdls to print file paths and sizes when enumerating host resources. xargs -0 mdls -n kMDItemPath -n kMDItemFSSize

T1497Virtualization/Sandbox EvasionEvidence3

Use mdls to validate payload download sources and timestamps to guard against sandbox executions. mdls -name "kMDItemWhereFroms" -name "kMDItemDownloadedDate"

T1497.001System ChecksEvidence2

I could also see this used as an anti-sandbox check, since sandbox analysis systems won’t have such entry in the LSQuarantineEvent table when submitting a sample for analysis.

T1518Software DiscoveryEvidence1

As mentioned above, this variant OSX/Shlayer.F queries QuarantineEventsV2 as follows: sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* ‘select LSQuarantineDataURLString from LSQuarantineEvent where LSQuarantineDataURLString like “%s3.amazonaws.com%” order by LSQuarantineTimeStamp desc limit 5’

Collection

1 technique
T1560Archive Collected DataEvidence3

This variant of bash scripts uses head or tail commands to invoke an encrypted zip file using funzip utility.

Command and Control

3 techniques
T1071Application Layer ProtocolEvidence1

I wanted to revisit the OSX/Shlayer.F variant of the Shlayer malware to report on a technique that has not previously been seen in other macOS malware for hiding Command and Control (C2) information. This variant encrypts its configuration using AES within the DMG file header structure, resulting in a modified DMG file.

T1071.001Web ProtocolsEvidence1

A majority of binaries in our intelligence systems downloaded the Bundlore payload to the tmp directory using curl request to the C2.

T1105Ingress Tool TransferEvidence3

The bash files download the second-stage adware payload which lures the victim to generally install a fake version of flash player.

Impact

1 technique
T1486Data Encrypted for ImpactEvidence1

This variant encrypts its configuration using AES within the DMG file header structure, resulting in a modified DMG file.

INDICATORS OF COMPROMISE

IOCs tracked for this family

25 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Full values are available in Mallory.

View more in app
Network
11 tracked

IPs, domains, and DNS infrastructure linked to this family.

Hashes
5 tracked

File hashes (MD5, SHA-1, SHA-256) from samples and reports.

Other
9 tracked

Other indicator types observed in public reporting.

TypeValueLatest sighting
domain●●●●●●●●●●●●View more in app2 months ago
domain●●●●●●●●●●●●View more in app2 months ago
hash.sha256●●●●●●●●●●●●View more in app2 months ago
uri●●●●●●●●●●●●View more in app2 months ago
domain●●●●●●●●●●●●View more in app2 months ago
domain●●●●●●●●●●●●View more in app4 months ago
What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets match these IOCs, which detections are missing, which campaigns to expect next, and what to do in the next 30 minutes.
IOC matching25

Match every observed IP, domain, and hash against your live telemetry.

Threat actor attribution2

Named campaigns wielding this family, with evidence pinned to each claim.

Exploited vulnerabilities

CVEs this family uses for access and lateral movement.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

MITRE ATT&CK mapping27

Every documented technique, ranked by evidence weight.

Researcher chatter

Reddit, Mastodon, and CTI community discussion around this family.