Living Off The Ecosystem
The implicit attack surface. Files, env vars, flags and hooks that run on install, at startup, on import, and when a command starts.
Install time
Interpreter startup
Module resolution
- __init__.py execution on importFile
__init__.py in any package directory on sys.path - .pyc bytecode cache poisoningFile
.pyc files in __pycache__/ directories alongside source modules - PYTHONPATH / PYTHONHOME module shadowingEnv var
PYTHONPATH / PYTHONHOME environment variables - .egg files and EGG-INFO scriptsFile · deprecated
.egg files in site-packages (registered via easy-install.pth) - Zip imports (zipimport)File
.zip / .pyz files on sys.path, or passed directly to the interpreter