heroui logo

Python Site or User Customize File Creation

Elastic Detection Rules

View Source
Summary
This detection rule focuses on identifying unauthorized creation and modification of the Python files `sitecustomize.py` and `usercustomize.py`, which are executed automatically by Python at startup. These files are often targeted by attackers seeking to establish persistence on Linux systems by injecting malicious code. The rule monitors various locations to capture suspicious activity related to these files, thereby helping to detect potential backdooring attempts that could compromise the system's security. By analyzing event types, the rule considers file creation and renaming activities performed by processes that are not part of commonly trusted Python executable paths. This approach minimizes false positives and enhances the reliability of the detection mechanism while adhering to the Elastic Defend data integration requirements.
Categories
  • Endpoint
Data Sources
  • File
ATT&CK Techniques
  • T1546
  • T1574
  • T1059
  • T1059.004
Created: 2025-02-26