111/TCP/UDP - Pentesting Portmapper

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

支持HackTricks的其他方式:

基本信息

端口映射器是一种用于将网络服务端口映射到RPC(远程过程调用)程序编号的服务。它是基于Unix系统中的一个关键组件,促进这些系统之间的信息交换。与端口映射器相关联的端口经常受到攻击者的扫描,因为它可以揭示有价值的信息。这些信息包括正在运行的Unix操作系统(OS)的类型以及系统上可用服务的详细信息。此外,端口映射器通常与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 - NFS服务渗透测试以了解如何测试此协议。

NIS

探索NIS漏洞涉及一个两步过程,首先是识别服务ypbind。这一探索的基石是揭示NIS域名,没有它,进展将停滞不前。

探索之旅始于安装必要的软件包(apt-get install nis)。随后的步骤需要使用ypwhich通过域名和服务器IP对NIS服务器进行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 文件

主文件

映射

备注

/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红队专家)

其他支持HackTricks的方式:

最后更新于