RPCBind Exposed Services Assessment
The portmapper itself is not the vulnerability — the danger is what it reveals. Each registered RPC program is a potential attack surface. This page covers assessing the most dangerous programs that appear in rpcinfo output: NFS without authentication, NIS/YP password database exposure, and rexd remote execution. Run RPC program enumeration first to build the full program list before working through these checks.
NFS — Unauthenticated Export Access
If mountd and nfs appear in the rpcinfo output, enumerate NFS exports immediately. Unauthenticated access to NFS exports is the most common high-impact finding from portmapper enumeration:
Export list for 10.10.10.50: /home * /var/nfs/data 10.10.10.0/24 /backup *
Explain command
| -e | Show the NFS server's export list on the target host. |
| $TARGET_IP | Placeholder for the target host's IP address. |
An export with * in the access list means any host can mount it — no authentication required. /home * means all home directories are world-mountable. This is a critical finding — mount and read SSH keys, bash history, and application configs. Move to NFS enumeration for the full exploitation path.
alice bob admin service
Explain command
| -t nfs | Specifies the filesystem type to mount as NFS. |
| $TARGET_IP:/home | Remote NFS server IP and exported share path to mount. |
| /tmp/nfs_test | Local mount point directory for the NFS share. |
| -o nolock | Disables NFS file locking, useful when lockd is unavailable. |
NIS/YP — Password Database Exposure
If ypserv (100004) or ypbind (100007) appear in rpcinfo output, NIS is running. NIS stores password hashes in a map accessible to any NIS domain member — and sometimes to any host on the network:
100004 2 tcp 645 ypserv 100007 2 tcp 657 ypbind
Explain command
| -p | Probe portmapper on the specified host and list all RPC programs. |
| $TARGET_IP | Placeholder for the target host IP address to query. |
| -iE | Case-insensitive match using extended regular expressions. |
| ypserv|ypbind|100004|100007 | Filter for NIS server/binder services by name or RPC program number. |
10.10.10.50
Explain command
| -d $DOMAIN | Specifies the NIS domain name to query. |
| $TARGET_IP | Target host to query for its NIS master server binding. |
root:$1$abc123$hashhere:0:0:root:/root:/bin/bash alice:$1$xyz789$hashhere:1001:1001::/home/alice:/bin/bash
Explain command
| -d $DOMAIN | Specifies the NIS domain name to query. |
| -h $TARGET_IP | Specifies the NIS server host IP address to connect to. |
| passwd | NIS map name to retrieve (passwd entries from the NIS database). |
ypcat passwd returning password hashes confirms the NIS password map is readable. Crack the hashes with hashcat mode 500 (MD5crypt) or mode 1800 (SHA512crypt) depending on the hash format. The NIS domain name is needed — try to obtain it from the target or brute force common names:
local: can't bind to NIS server nis: root:$1$abc123... corp: can't bind to NIS server
rexd — Remote Execution Without Authentication
rexd (program 100017) is a remote execution daemon that accepts arbitrary command execution from any host. Its presence is a critical finding on any modern system:
100017 1 tcp 512 rexd
Explain command
| -p | Query the portmapper on the specified host and list all RPC programs. |
| $TARGET_IP | Placeholder for the target host IP address to query. |
uid=0(root) gid=0(root) groups=0(root)
Explain command
| -d | Specifies the remote host to connect to and run the command on. |
| $TARGET_IP | Placeholder for the target machine's IP address. |
| id | Command to execute remotely, prints current user identity info. |
rexd responding to the on command with command output is unauthenticated remote code execution. This is an immediate critical finding. The on utility is part of the rsh-client package on Debian/Ubuntu.
RPCBind Reachable from External Position
Port 111 should never be reachable from untrusted networks. Confirm whether the portmapper is internet-facing or only internal:
111/tcp open rpcbind 2-4 (RPC #100000)
Explain command
| -sV | Probe open ports to determine service and version info. |
| -p 111 | Scan only port 111 (portmapper/rpcbind). |
| $TARGET_IP | Placeholder for the target host IP address. |
| --open | Show only ports with an open state in results. |
Port 111 open from an external or untrusted network position is a misconfiguration finding even if no dangerous programs are registered. The portmapper provides a full inventory of internal services to any connecting host — information that should not be externally accessible.
Assess All Unknown Programs
Programs showing up as numeric IDs without names are custom or less common RPC services. Scan their ports directly and fingerprint them:
34219 48103 52771
Explain command
| -p | Probe portmapper on the target and list all registered RPC programs. |
| $TARGET_IP | Placeholder for the target host IP address to query. |
| NR>1 | awk condition to skip the header line (first row) of rpcinfo output. |
| {print $4" "$5} | awk action to print the protocol and port fields only. |
| -u | sort flag to output only unique lines, removing duplicates. |
| -v | grep flag to invert match, excluding lines matching the pattern. |
| rpcbind\|nfs\|mountd\|nlockmgr\|status | Pattern to exclude common expected RPC services from results. |
Explain command
| -sV | Probe open ports to determine service/version information. |
| -p 34219,48103,52771 | Scan only the specified comma-separated ports. |
| $TARGET_IP | Placeholder for the target host IP address. |
References
-
nmap — rpcinfo NSEnmap.org/nsedoc/scripts/rpcinfo.html (opens in new tab)
RPC program enumeration and port mapping
Was this helpful?
Your feedback helps improve this page.