21 hours 43 minutes
are learning objectives are to understand what NFS is used for and demonstrate how to enumerate nFS.
So NFS stands for network file system was developed back in 1984 by Sun Microsystems is kind of like SMB in that it allows you to interact remotely with directories and files on a remote host.
Um You can also mount it to your file system, which I'll demonstrate later.
Uh so it's an open standard. Um anyone can use it and we have a bunch of different tools we can use to enumerate the service as you can see here. We're using Rpc info and we're looking at the different ports, so, you know, we can use End Map as well. But here rpc info is telling us some ports that
are in use by NFS
and you'll see both TCP and udp.
All right. Like I said, um you know, we use SMB client for SMB here, we're actually mounting the shares directly onto our machine are Cali machine
and you can see here we're using show mount tak E to see which which directories that we have access to. In this case we have access to all of them. And I'll say please pay attention because you're actually gonna be using this in the lab.
So once you show mountain, you can see which directories you can mount. Then what you're going to do is you're going to make a directory in your mount directory. Um actually mount that share um onto your machine and then you actually have access to that remote system.
So then what you can do is once you have access to that remote system you can interact uh and ultimately get access to that machine. As we can see here. Um We are making an ssh key,
we are putting that into the remote hosts authorized keys
and then um mounting uh mount nfs and then using ssh to get onto that machine.
So I'm going to show that to you in a demo. Now.
I did want to mention though, before the demo that simply mounting shares,
it's not enough, you know, SCP to consider getting a shell on a road system. You actually do have to get a shell. So just because you can see files on the road system doesn't mean you've owned that system.
All right. So here's the demo we're gonna do is we're going to look at our pc info attack P and our our host that we're looking at enumerating
and you can see here
we have that port mapper service I referenced in the other slide. We have TCP and UDP. We also have N. F s, both UDP and TCP on port 2049.
So now we're gonna use show amount to see what we have access to.
I'll clear this
well you show Mtac E and you can see have access to everything, which is great.
Everything meaning the whole directory structure of this remote host.
So what I'm gonna do now is make a directory in my
mount directory called NFS
or exists, I've already done it for you. You'll you'll make this directory, you can call it whatever you want. It doesn't have to be NFS.
Now we're gonna do is mount it
meaning mount that remote host into this mount Nfs directory.
So mount tack T Nfs, the remote host.
like I was talking about if we go mount
and if s
we can see here that we have access, like I said to this remote system.
And what we can do now is do something like
nfs etc. Password.
As you can see here, I can now read this remote host etc. Password file.
So like I was talking about, you know, we want to get on this machine now and since this is a Lennox machine um and we know that as ssh from our previous enumeration, I know you didn't see that but
for for sake of argument here, let's say have already looked at this machine. I've already seen that. Ssh is open.
So I'm going to do is create an ssh key. So I'm gonna use Ssh key gen.
So here we're creating our public private key pair. I'm just gonna put it in this directory here.
I've already done this but I'm gonna do it again. I'm gonna overwrite my previous keys.
You can enter a pass phrase. I'm not just gonna hit, enter, enter again.
And we've generated those keys.
So now I'm gonna do is I'm going to take that key and I'm gonna put her in the authorized the public he I should say
so I'm casting that public key and I'm
putting this now into the authorized keys of of this remote host.
So if we wanted to see this
we could cat mount authorized keys
and you can see there's a few other
keys I have here, cyber ninja that I've done this before,
but we have our public he in here.
So what I can do now is I can ssh in as the root user
and now we are route on the municipal cable box
and that's how you can use nFS from enumeration to actually exploiting this service and getting on this machine.
So like I said, you're gonna have a chance to do this in the lab.
Um so hopefully now you understand what NFS is used for and you can demonstrate how to enumerate an NFS uh with that hands on demo, and like I said, you'll be doing that yourself um in the lab.