Common attacks and weaknesses
- Exports open to any host, no_root_squash giving root access to files.
Network File System shares.
Files are sent over port 2049 in pieces and reassembled on the other side. It travels in clear text: anyone on the path can read it, passwords included.
| Service | Port | Transport | Description | Reference | Updated |
|---|---|---|---|---|---|
| nfs | 2049 | TCP, UDP, SCTP | Network File System - Sun Microsystems | - | - |
| shilp | 2049 | TCP, UDP | - | - |
// source: IANA service name and port number registry
Linux
sudo ss -ltnup 'sport = :2049' # process listening on 2049
sudo lsof -nP -i :2049macOS
sudo lsof -nP -i :2049
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 2049 -State Listen | Select LocalAddress, OwningProcess Get-NetUDPEndpoint -LocalPort 2049 netstat -ano | findstr :2049
From another machine
nmap -p 2049 -sV <host> sudo nmap -sU -p 2049 <host> nc -zv <host> 2049
Block it in the firewall
sudo ufw deny 2049/tcp # Linux (ufw) New-NetFirewallRule -DisplayName "Block 2049" -Direction Inbound -LocalPort 2049 -Protocol TCP -Action Block # Windows
Network File System shares.
Port 2049 is registered for TCP and UDP and SCTP. In practice the service mostly uses TCP and UDP.
It is rated 7/10 (high) when exposed to the Internet. Exports open to any host, no_root_squash giving root access to files. Restrict exports to specific hosts, keep root_squash, use Kerberos (sec=krb5p).
On Linux run "ss -ltnup 'sport = :2049'", on macOS "lsof -nP -i :2049", and on Windows "netstat -ano | findstr :2049" to see the local process. From another machine, "nmap -p 2049 <host>" shows whether it is reachable.