T1546.018 Python Startup Hooks
PersistencePrivilege Escalationon attack.mitre.org
ATT&CK Enterprise 20.0 · 20.1 released, update in review
How MITRE detects it
DET0258 Linux Python Startup Hook Persistence via .pth and Customize Files (T1546.018)
AN0713 Linux
Defender observes unauthorized modification or creation of Python hook files such as `.pth`, `sitecustomize.py`, or `usercustomize.py` in Python `site-packages`, `dist-packages`, or user paths. This is often correlated with subsequent unexpected interpreter execution (e.g., python3 running without user interaction), changes in interpreter behavior (e.g., malicious imports), and outbound connections initiated from Python. Defender links write/modify actions on hook files with execve of python process and/or anomalous child process or network activity.
| MITRE log source | In Microsoft Sentinel |
|---|---|
auditd:SYSCALLexecve: execve where exe=/usr/bin/python3 or similar interpreter | Not mapped to Sentinel yet. |
auditd:PATHwrite or create events on *.pth, sitecustomize.py, usercustomize.py in site-packages or dist-packages | Not mapped to Sentinel yet. |
auditd:CONFIG_CHANGEchmod or chown of hook files indicating privilege escalation or execution permission change | Not mapped to Sentinel yet. |
NSM:Flowhttp::request: Outbound HTTP initiated by Python interpreter | Not mapped to Sentinel yet. |
Content Hub rules tagged with it (0)
No Content Hub rule is tagged with this technique.
In Sigma rules
Mitigations
- None listed by MITRE.
MITRE ATT&CK® is a registered trademark of The MITRE Corporation. VeriKQL is not affiliated with or endorsed by MITRE. ATT&CK data © The MITRE Corporation, used under its terms of use.