111/TCP/UDP - Pentesting Portmapper

从零开始学习 AWS 黑客技术,成为专家 htARTE(HackTricks AWS 红队专家)

支持 HackTricks 的其他方式:

基本信息

Portmapper 是一个用于将网络服务端口映射到 RPC(远程过程调用)程序编号的服务。它是 Unix 系统中的一个关键组件,促进这些系统之间的信息交换。与 Portmapper 关联的 端口 经常受到攻击者的扫描,因为它可以揭示有价值的信息。这些信息包括正在运行的 Unix 操作系统(OS) 的类型以及系统上可用服务的详细信息。此外,Portmapper 通常与 NFS(网络文件系统)NIS(网络信息服务) 和其他基于 RPC 的服务一起使用,以有效管理网络服务。

默认端口: 111/TCP/UDP,Oracle Solaris 中为 32771

PORT    STATE SERVICE
111/tcp open  rpcbind

枚举

rpcinfo irked.htb
nmap -sSUC -p111 192.168.10.1

Shodan

  • port:111 portmap

RPCBind + NFS

如果发现了 NFS 服务,那么可能您将能够列出、下载(也许还可以上传)文件:

阅读2049 - Pentesting NFS service以了解如何测试此协议。

NIS

探索 NIS 漏洞涉及到一个两步骤的过程,首先是识别服务 ypbind。这一探索的基石是揭示 NIS 域名,没有这个信息,进展将受阻。

探索之旅始于安装必要的软件包(apt-get install nis)。随后的步骤需要使用 ypwhich 确认 NIS 服务器的存在,通过使用域名和服务器 IP 对其进行ping测试,确保这些元素经过匿名化以确保安全性。

最后、也是至关重要的一步是使用 ypcat 命令提取敏感数据,特别是加密的用户密码。这些哈希值一旦使用像 John the Ripper 这样的工具破解,将揭示有关系统访问和权限的见解。

# Install NIS tools
apt-get install nis
# Ping the NIS server to confirm its presence
ypwhich -d <domain-name> <server-ip>
# Extract user credentials
ypcat –d <domain-name> –h <server-ip> passwd.byname

NIF 文件

主文件

映射(s)

注释

/etc/hosts

hosts.byname, hosts.byaddr

包含主机名和 IP 详细信息

/etc/passwd

passwd.byname, passwd.byuid

NIS 用户密码文件

/etc/group

group.byname, group.bygid

NIS 组文件

/usr/lib/aliases

mail.aliases

详细的邮件别名

RPC 用户

如果发现列出了 rusersd 服务,如下所示:

您可以枚举该主机的用户。要了解如何进行操作,请阅读 1026 - Pentesting Rsusersd

绕过被过滤的 Portmapper 端口

在进行 nmap 扫描 时,发现开放的 NFS 端口中的端口 111 被过滤,直接利用这些端口是不可行的。然而,通过在本地模拟一个 portmapper 服务,并从您的计算机创建到目标的隧道,使用标准工具就变得可能了。这种技术允许绕过端口 111 的过滤状态,从而实现对 NFS 服务的访问。有关此方法的详细指导,请参考 此链接 上提供的文章。

Shodan

  • Portmap

实践实验室

HackTricks 自动命令

Protocol_Name: Portmapper    #Protocol Abbreviation if there is one.
Port_Number:  43     #Comma separated if there is more than one.
Protocol_Description: PM or RPCBind        #Protocol Abbreviation Spelled out

Entry_1:
Name: Notes
Description: Notes for PortMapper
Note: |
Portmapper is a service that is utilized for mapping network service ports to RPC (Remote Procedure Call) program numbers. It acts as a critical component in Unix-based systems, facilitating the exchange of information between these systems. The port associated with Portmapper is frequently scanned by attackers as it can reveal valuable information. This information includes the type of Unix Operating System (OS) running and details about the services that are available on the system. Additionally, Portmapper is commonly used in conjunction with NFS (Network File System), NIS (Network Information Service), and other RPC-based services to manage network services effectively.

https://book.hacktricks.xyz/pentesting/pentesting-rpcbind

Entry_2:
Name: rpc info
Description: May give netstat-type info
Command: whois -h {IP} -p 43 {Domain_Name} && echo {Domain_Name} | nc -vn {IP} 43

Entry_3:
Name: nmap
Description: May give netstat-type info
Command: nmap -sSUC -p 111 {IP}
从零开始学习AWS黑客技术,成为专家 htARTE(HackTricks AWS Red Team Expert)

其他支持HackTricks的方式:

最后更新于