DEV Community

Thalita
Thalita

Posted on

NFS - Enumeration

Funciona na porta 2049 TCP.

Varremos a rede pela porta 2049 com o nmap.

Explore o serviço de NFS do servidor 172.16.1.31 e obtenha a chave.

nmap -sS --open -p 2049 <alvo>
Enter fullscreen mode Exit fullscreen mode

Primeira coisa: ver as versões que esse protocolo suporta:

rpcinfo -p <alvo> | grep nfs
Enter fullscreen mode Exit fullscreen mode

Depois usamos o showmount -e para ver quais compartilhamentos foram compartilhados:

showmount -e <alvo>
Enter fullscreen mode Exit fullscreen mode

Agora que descobrimos os diretórios disponíveis, devemos montá-los para tentar acessá-los:

Criamos um diretório em nossa máquina:

mkdir /tmp/nfs
Enter fullscreen mode Exit fullscreen mode

Depois usamos mount -t para montarmos o compartilhamento entre o que acabamos de montar e o que descobrimos no alvo:

Fazemos:

mount -t nfs -o nfsvers=2 (número da versão que fica disponível no alvo, vamos testando...)
Enter fullscreen mode Exit fullscreen mode
mount -t nfs -o nfsvers=2 172.16.1.31:/home/camila /tmp/nfs
Enter fullscreen mode Exit fullscreen mode

Assim, montamos o diretório /home/camila dentro do diretório /tmp/nfs que criamos.

Entramos no diretório:

cd /tmp/nfs
Enter fullscreen mode Exit fullscreen mode

E vemos tudo de /home/camila nele.

Podemos mexer em todos os arquivos que estão dentro desse sistema.

Inglês:

Operates on port 2049 TCP.

We scan the network on port 2049 using nmap.

Explore the NFS service of the server 172.16.1.31 and obtain the key.

nmap -sS --open -p 2049 <target>
Enter fullscreen mode Exit fullscreen mode

First thing: check the versions that this protocol supports:

rpcinfo -p <target> | grep nfs
Enter fullscreen mode Exit fullscreen mode

Then we use showmount -e to see which shares have been shared:

showmount -e <target>
Enter fullscreen mode Exit fullscreen mode

Now that we have discovered the available directories, we must mount them to try to access them:

We create a directory on our machine:

mkdir /tmp/nfs
Enter fullscreen mode Exit fullscreen mode

Then we use mount -t to mount the share between what we just mounted and what we discovered on the target:

We do:

mount -t nfs -o nfsvers=2 (version number available on the target, testing...)
Enter fullscreen mode Exit fullscreen mode
mount -t nfs -o nfsvers=2 172.16.1.31:/home/camila /tmp/nfs
Enter fullscreen mode Exit fullscreen mode

This way, we mount the /home/camila directory inside the /tmp/nfs directory that we created.

We enter the directory:

cd /tmp/nfs
Enter fullscreen mode Exit fullscreen mode

And see everything from /home/camila in it.

We can manipulate all the files within this system.

Top comments (0)