GTFOBins.github.io
GTFOBins.github.io copied to clipboard
Create shutdown.md
ref : https://exploit-notes.hdks.org/exploit/linux/privilege-escalation/sudo/sudo-shutdown-poweroff-privilege-escalation/
if user hash sudo shutdown privilege , we can use this command get root shell
nice
This makes no sense: PATH does not propagate through sudo.
sudo specifically has the directive secure_path which sets the PATH variable when you use sudo. On Ubuntu 2204, it's set by default to:
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
An administrator would have to specifically set secure_path
to include /tmp
, which there would never been a reason to do that.
Looking at the other notes from this website like https://exploit-notes.hdks.org/exploit/linux/privilege-escalation/sudo/sudo-reboot-privilege-escalation/, the situations here are completely unbelievable.