111/TCP/UDP - Pentesting Portmapper

Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)

Support HackTricks

Basic Information

Portmapper는 네트워크 서비스 포트를 RPC (원격 프로시저 호출) 프로그램 번호에 매핑하는 데 사용되는 서비스입니다. 이는 유닉스 기반 시스템에서 중요한 구성 요소로 작용하여 이러한 시스템 간의 정보 교환을 용이하게 합니다. Portmapper와 관련된 포트는 공격자에 의해 자주 스캔되며, 이는 귀중한 정보를 드러낼 수 있습니다. 이 정보에는 실행 중인 **유닉스 운영 체제 (OS)**의 유형과 시스템에서 사용할 수 있는 서비스에 대한 세부 정보가 포함됩니다. 또한, PortmapperNFS (네트워크 파일 시스템), 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를 사용하여 도메인 이름과 서버 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 파일

마스터 파일

노트

/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를 참조하세요.

필터링된 포트매퍼 포트 우회

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 해킹 배우기 및 연습하기:HackTricks Training AWS Red Team Expert (ARTE) GCP 해킹 배우기 및 연습하기: HackTricks Training GCP Red Team Expert (GRTE)

HackTricks 지원하기

Last updated