← Back to SOC feed Coverage →

locate-shlayer-payload-decrytion-activity

kql MEDIUM Azure-Sentinel
DeviceProcessEvents
huntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-20T23:00:01Z · Confidence: medium

Hunt Hypothesis

The hypothesis is that the detection identifies potential Shlayer adware payload decryption activity, which is a sign of an adversary attempting to execute malicious code and maintain persistence. SOC teams should proactively hunt for this behavior in Azure Sentinel to detect and mitigate adware campaigns that can compromise user data and network integrity.

KQL Query

// Find use of the Shlayer OpenSSL command to decode and decrypt a payload
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName =~ "openssl"
and ProcessCommandLine has "-base64" and
ProcessCommandLine has "-out"  and
ProcessCommandLine has "-nosalt"
and ProcessCommandLine has_any("-aes256", "-aes-256")

Analytic Rule Definition

id: 7abb6bbb-cb2b-4702-a96d-8d53b7a8e054
name: locate-shlayer-payload-decrytion-activity
description: |
  This query was originally published in the threat analytics report, OSX/Shlayer sustains adware push.
  Shlayer is adware that spies on users' search terms, and redirects network traffic to serve the user attacker-controlled search results containing ads.
  The following query locates activity associated with the Shlayer payload decrypter.
  Reference - https://www.intego.com/mac-security-blog/osxshlayer-new-mac-malware-comes-out-of-its-shell/
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceProcessEvents
tactics:
- Execution
query: |
  // Find use of the Shlayer OpenSSL command to decode and decrypt a payload
  DeviceProcessEvents
  | where Timestamp > ago(7d)
  | where FileName =~ "openssl"
  and ProcessCommandLine has "-base64" and
  ProcessCommandLine has "-out"  and
  ProcessCommandLine has "-nosalt"
  and ProcessCommandLine has_any("-aes256", "-aes-256")

Required Data Sources

Sentinel TableNotes
DeviceProcessEventsEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Execution/locate-shlayer-payload-decrytion-activity.yaml