Suspicious Python Startup .pth File Creation for Interpreter Persistence

PremiumReviewedSigma · Medium · v1
Product
linux
Category
file_event
Author
HuntRule
Published
2026-08-23
Updated
2026-08-28

ATT&CK techniques

Initial Access → Execution
  1. Recon

  2. Resource Dev

  3. Persistence

  4. Priv Esc

  5. Defense Evasion

  6. Cred Access

  7. Discovery

  8. Lateral Movement

  9. Collection

  10. C2

  11. Exfiltration

  12. Impact

What it detects

This rule detects creation of the litellm_init.pth Python path-configuration file. The LiteLLM supply-chain attack abused a .pth file that Python auto-executes at interpreter startup to run attacker code whenever the environment is used as documented by Kaspersky. A malicious .pth dropped into a site-packages directory grants stealthy persistence tied to every Python invocation.

Related detections9 linkedT1059.006 — drag to rearrange
Malicious TeamPCP LiteLLM .pth Startup Hook and Payload Dropper (via file_event)
Malicious AI CLI Anti-Attribution and Permission Bypass Flags
Suspicious Python HTTP Server Staging for Payload Delivery
Suspicious Python Base64 Encoded Command Execution (via process_creation)
Suspicious __init__.py Drop in Public Directory by Slow Pisces (via file_event)
Malicious Python Reverse Shell One-Liner Execution (via process_creation)
Suspicious Silver Fox Backdoor Execution via pythonw appclient Module (via process_creation)
Suspicious Malicious MCP Package devtools-assistant Execution (via process_creation)
Suspicious Cursor Editor Process Spawning PowerShell
Suspicious Python Startup .pth File Creation for Interpreter Persistence
Pivot detection · T1059.006 · 9 related

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.