Unusual Library Load via Python

Last updated 12 days ago on 2026-01-30
Created 12 days ago on 2026-01-30

About

Detects when a Python process loads an unusual library from within the user's home directory where the file is not a standard .so or .dylib file. This technique has been observed in APT campaigns by the Lazarus Group and Slow Pisces to load malicious payloads.
Tags
Domain: EndpointOS: macOSUse Case: Threat DetectionTactic: ExecutionData Source: Elastic DefendLanguage: eql
Severity
high
Risk Score
73
MITRE ATT&CK™

Execution (TA0002)(external, opens in a new tab or window)

License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
Event Correlation Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-endpoint.events.library-*
Related Integrations

endpoint(external, opens in a new tab or window)

Query
text code block:
library where host.os.type == "macos" and event.action == "load" and dll.path like "/Users/*" and process.name like "python*" and not dll.name like ("*.so", "*.dylib", "Python", "*.*_extension", "*.dylib.*") and not dll.path like ("*/site-packages/*/Qt*/lib/Qt*.framework/Versions/*/Qt*", "/Users/*/.pyenv/versions/*/lib/python*/site-packages/*")

Install detection rules in Elastic Security

Detect Unusual Library Load via Python in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).