NFS exploits
Become root on Linux via NFS exploits:
Look for no_root_squash shares
Mount share
Create a payload
Bash binary with an SUID bit
C binary with an SUID bit
Execute the payload on the target mac hine to escalate privileges
Unmount the shared directory in the attacker machine
Notes
The NFS configuration file is /etc/exports
:
no_root_squash
: This option basically gives authority to the root user on the client (us, our attacker host) to access files on the NFS server as root. This is bad, as we can create malicious files on the NFS share as the root user.no_all_squash
: This is similar to no_root_squash option but applies to non-root users.