MacOS Installer Package Spawns Network Eventedit

Detects the execution of a MacOS installer package with an abnormal child process (e.g bash) followed immediately by a network connection via a suspicious process (e.g curl). Threat actors will build and distribute malicious MacOS installer packages, which have a .pkg extension, many times imitating valid software in order to persuade and infect their victims often using the package files (e.g pre/post install scripts etc.) to download additional tools or malicious software. If this rule fires it should indicate the installation of a malicious or suspicious package.

Rule type: eql

Rule indices:


Severity: medium

Risk score: 74

Runs every: 5 minutes

Searches indices from: now-9m (Date Math format, see also Additional look-back time)

Maximum alerts per execution: 100



  • Elastic
  • Host
  • macOS
  • Threat Detection
  • Execution
  • Command and Control

Version: 6 (version history)

Added (Elastic Stack release): 7.12.0

Last modified (Elastic Stack release): 8.4.0

Rule authors: Elastic

Rule license: Elastic License v2

Potential false positivesedit

Custom organization-specific macOS packages that use .pkg files to run cURL could trigger this rule. If known behavior is causing false positives, it can be excluded from the rule.

Rule queryedit

sequence by, with maxspan=30s [process where
event.type == "start" and event.action == "exec" and : ("installer", "package_script_service") and : ("bash", "sh", "zsh", "python", "osascript", "tclsh*")]
[network where event.type == "start" and : ("curl",
"osascript", "wget", "python")]

Threat mappingedit


Rule version historyedit

Version 6 (8.4.0 release)
  • Rule name changed from: macOS Installer Spawns Network Event
  • Updated query, changed from:

    sequence by process.entity_id with maxspan=1m [process where
    event.type == "start" and == "macos" and
    process.parent.executable in ("/usr/sbin/installer",
    ] [network where not cidrmatch(destination.ip, "",
    "", "", "", "",
    "", "", "", "",
    "", "", "", "",
    "", "", "", "",
    "", "", "",
    "", "", "", "::1",
    "FE80::/10", "FF00::/8")]
Version 4 (8.2.0 release)
  • Formatting only
Version 3 (7.15.0 release)
  • Formatting only
Version 2 (7.14.0 release)
  • Updated query, changed from:

    sequence by process.entity_id with maxspan=1m [ process where
    event.type == "start" and == "macos" and
    process.parent.executable in ("/usr/sbin/installer",
    ] [ network where not cidrmatch(destination.ip,
    "", "", "",
    "", "", "",
    "::1", "FE80::/10", "FF00::/8") ]