Suspicious Python Path Configuration Hook Persistence (via file_event)

PremiumReviewedSigma · Medium · v1
Product
linux
Category
file_event
Author
HuntRule
Published
2026-10-18
Updated
2026-10-18

ATT&CK techniques

Persistence → Priv Esc
  1. Recon

  2. Resource Dev

  3. Initial Access

  4. Execution

  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 used in the TeamPCP supply chain attack to run code automatically when the interpreter starts. A .pth file with an import hook executes attacker code on every Python invocation, providing stealthy persistence within the software environment.

Related detections9 linkedT1546 — drag to rearrange
Suspicious Zsh Persistence via zshrc_aliases Appended to Shell Startup (via process_creation)
Malicious UNC4841 Dropper Deployment to Boot Partition via mknod (via process_creation)
Suspicious NetworkManager Dispatcher Script Persistence
Suspicious APT Or YUM Package Manager Hook Configuration Created
AdminSDHolder Permissions Changed for Persistence (via security)
Suspicious Persistence via Shell Script Dropped in profile.d Directory (via file_event)
Suspicious Command Processor AutoRun Persistence via Registry Set
Suspicious Python Site Hook or PTH File Written to Site-Packages via File Event
Suspicious MOTD Or Git Hook Script Creation For Linux Persistence
Suspicious Python Path Configuration Hook Persistence (via file_event)
Pivot detection · T1546 · 9 related

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