Monday, May 30, 2022

Try Hack Me Network Services 2: Task 2 Understanding NFS

What is NFS?
NFS stands for "Network File System" and allows a system to share directories and files with others over a network. By using NFS, users and programs can access files on remote systems almost as if they were local files. It does this by mounting all, or a portion of a file system on a server. The portion of the file system that is mounted can be accessed by clients with whatever privileges are assigned to each file.

 

How does NFS work?

We don't need to understand the technical exchange in too much detail to be able to exploit NFS effectively- however if this is something that interests you, I would recommend this resource:  https://docs.oracle.com/cd/E19683-01/816-4882/6mb2ipq7l/index.html
First, the client will request to mount a directory from a remote host on a local directory just the same way it can mount a physical device. The mount service will then act to connect to the relevant mount daemon using RPC.
The server checks if the user has permission to mount whatever directory has been requested. It will then return a file handle which uniquely identifies each file and directory that is on the server.

If someone wants to access a file using NFS, an RPC call is placed to NFSD (the NFS daemon) on the server.  This call takes parameters such as:
  •  The file handle
  •  The name of the file to be accessed
  •  The user's, user ID
  •  The user's group ID
 
These are used in determining access rights to the specified file. This is what controls user permissions, I.E read and write of files.
 
What runs NFS?
Using the NFS protocol, you can transfer files between computers running Windows and other non-Windows operating systems, such as Linux, MacOS or UNIX.
A computer running Windows Server can act as an NFS file server for other non-Windows client computers. Likewise, NFS allows a Windows-based computer running Windows Server to access files stored on a non-Windows NFS server. 

More Information:
Here are some resources that explain the technical implementation, and working of, NFS in more detail than I have covered here. 

https://www.datto.com/library/what-is-nfs-file-share

 http://nfs.sourceforge.net/

 https://wiki.archlinux.org/index.php/NFS 


Answer the questions below 

To see the answer, just highlight the green area.

What does NFS stand for?

How to: This answer can be found in the Whats NFS paragraph above.

Answer: Network File System

 

What process allows an NFS client to interact with a remote directory as though it was a physical device?

How to: The answer to this question can be found in the How NFS works paragraph above.

Answer: mounting

Hint: What does your Operating System do to access a physical drive?

 

What does NFS use to represent files and directories on the server?

How to: The answer to this question can be found towards the end of the How NFS works paragraph above.

Answer: file handle

 

What protocol does NFS use to communicate between the server and client?

How to: The answer to this question can be found towards the end of the How NFS works paragraph above.

Answer: RPC

 

What two pieces of user data does the NFS server take as parameters for controlling user permissions? Format: parameter 1 / parameter 2

How to: The answer to this question can be found towards the end of the How NFS works paragraph above.

Answer: user id / group id

 

Can a Windows NFS server share files with a Linux client? (Y/N)

How to: The answer to this question can be found in the What runs NFS section.

Answer: Y

 

Can a Linux NFS server share files with a MacOS client? (Y/N)

How to: The answer to this question can be found in the What runs NFS section.

Answer: Y

 

What is the latest version of NFS? [released in 2016, but is still up to date as of 2020] This will require external research.

How to: I went to Google and searched "NFS version".  One of the entries that came up was for the wiki page for NFS (https://en.wikipedia.org/wiki/Network_File_System), I clicked on that entry and scrolled down to the different versions, I was able to find the answer in there.

Answer: 4.2



No comments:

Post a Comment

TryHackMe Write-Up | Sysinternals Task 9  Miscellaneous

BgInfo "It automatically displays relevant information about a Windows computer on the desktop's background, such as the computer ...