Elastic medium stable kql

Launch Item Registration with Suspicious Executable Path via macOS Security Events

Identifies the registration of a launch agent or launch daemon whose target executable resides in a temporary or user-writable location, using launch item registration messages collected by the macOS Security Events integration. An adversary may establish persistence with a launch agent or daemon that runs a program staged in a world-writable or temporary directory, which is uncommon for legitimate software.

View Source

Detection Logic

FROM logs-macos.process_execution_monitoring-* metadata _id, _version, _index
| WHERE data_stream.dataset == "macos.process_execution_monitoring" and
    macos.event.message.description LIKE "*effectiveItemDisposition*" and
    (macos.event.message.description LIKE "*url=file://*/Library/LaunchAgents/*" or
        macos.event.message.description LIKE "*url=file://*/Library/LaunchDaemons/*")
| GROK macos.event.message.description "url=file://%{DATA:Esql.plist_path}, config"
| GROK macos.event.message.description "type=%{DATA:Esql.item_type},"
| GROK macos.event.message.description "BTMConfigExecutablePath = \"%{DATA:Esql.executable}\""
| WHERE Esql.executable RLIKE "/(private/)?(tmp
| var/tmp
| var/folders)/.*
| /Users/Shared/.*
| /Users/[^/]+/(Downloads
| Public
| Library/Caches)/.*"
| KEEP _id, _version, _index, @timestamp, host.name, Esql.executable, Esql.plist_path, Esql.item_type, macos.event.message.description

Field Validations

Loading…

Comments (0)

Loading comments...