111/TCP/UDP - Pentesting Portmapper

htARTE (HackTricks AWS Red Team 전문가)로부터 AWS 해킹을 제로부터 전문가까지 배우세요

HackTricks를 지원하는 다른 방법:

기본 정보

Portmapper는 네트워크 서비스 포트를 RPC (원격 프로시저 호출) 프로그램 번호로 매핑하는 데 사용되는 서비스입니다. 이는 Unix 기반 시스템에서 중요한 구성 요소로 작용하여 이러한 시스템 간의 정보 교환을 용이하게 합니다. Portmapper와 관련된 포트는 공격자에 의해 자주 스캔되며 가치 있는 정보를 노출할 수 있습니다. 이 정보에는 실행 중인 **Unix 운영 체제(OS)**의 유형 및 시스템에서 사용 가능한 서비스에 대한 세부 정보가 포함됩니다. 또한 Portmapper는 네트워크 서비스를 효과적으로 관리하기 위해 NFS (Network File System), NIS (Network Information Service) 및 기타 RPC 기반 서비스와 함께 일반적으로 사용됩니다.

기본 포트: 111/TCP/UDP, Oracle Solaris의 경우 32771

PORT    STATE SERVICE
111/tcp open  rpcbind

열거 (Enumeration)

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를 사용하여 도메인 이름과 서버 IP로 NIS 서버의 존재를 확인하는 것이며, 이러한 요소들이 보안을 위해 익명화되어 있는지 확인합니다.

마지막이자 중요한 단계는 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 파일

RPC 사용자

만약 rusersd 서비스가 다음과 같이 나열되어 있다면:

상자의 사용자를 열거할 수 있습니다. 자세한 내용은 1026 - Pentesting Rsusersd를 참조하세요.

필터링된 Portmapper 포트 우회

nmap 스캔을 수행하고 포트 111이 필터링된 상태에서 열린 NFS 포트를 발견하면, 이러한 포트의 직접적인 악용은 불가능합니다. 그러나 로컬로 포트맵퍼 서비스를 시뮬레이션하고 자신의 기기에서 대상으로 터널을 생성함으로써, 표준 도구를 사용하여 악용이 가능해집니다. 이 기술을 사용하면 포트 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를 지원하는 방법:

Last updated