2024-02-08 22:31:36 +00:00
# 111/TCP/UDP - ペンテスティング ポートマッパー
2022-04-28 16:01:33 +00:00
< details >
2024-02-09 09:15:30 +00:00
< summary > < strong > htARTE( HackTricks AWS Red Team Expert) < / strong > < a href = "https://training.hacktricks.xyz/courses/arte" > < strong > でAWSハッキングをゼロからヒーローまで学ぶ< / strong > < / a > < strong > ! < / strong > < / summary >
2022-04-28 16:01:33 +00:00
2024-02-08 22:31:36 +00:00
HackTricks をサポートする他の方法:
2024-01-03 00:54:19 +00:00
2024-02-08 22:31:36 +00:00
* **HackTricks で企業を宣伝したい** または **HackTricks をPDFでダウンロードしたい** 場合は [**SUBSCRIPTION PLANS** ](https://github.com/sponsors/carlospolop ) をチェックしてください!
2024-02-09 09:15:30 +00:00
* [**公式PEASS& HackTricksスワッグ** ](https://peass.creator-spring.com )を入手する
* [**The PEASS Family** ](https://opensea.io/collection/the-peass-family ) を発見し、独占的な [**NFTs** ](https://opensea.io/collection/the-peass-family ) のコレクションを見つける
* **💬 [**Discordグループ** ](https://discord.gg/hRep4RUj7f ) に参加するか、[**telegramグループ** ](https://t.me/peass ) に参加するか、**Twitter** 🐦 [**@carlospolopm** ](https://twitter.com/hacktricks_live ) をフォローする**
* **ハッキングトリックを共有するには、** [**HackTricks** ](https://github.com/carlospolop/hacktricks ) と [**HackTricks Cloud** ](https://github.com/carlospolop/hacktricks-cloud ) のGitHubリポジトリにPRを提出してください。
2022-04-28 16:01:33 +00:00
< / details >
2023-07-07 23:42:27 +00:00
## 基本情報
2020-07-15 15:43:14 +00:00
2024-02-09 09:15:30 +00:00
**ポートマッパー**は、ネットワークサービスポートを **RPC** ( Remote Procedure Call) プログラム番号にマッピングするために使用されるサービスです。これは、**Unixベースのシステム**において情報のやり取りを容易にするための重要なコンポーネントとして機能します。**ポートマッパー**に関連付けられた**ポート**は、攻撃者によって頻繁にスキャンされます。なぜなら、貴重な情報を明らかにする可能性があるからです。この情報には、実行中の**Unixオペレーティングシステム( OS) **の種類やシステムで利用可能なサービスの詳細が含まれます。さらに、**ポートマッパー**は、**NFS( Network File System) **、**NIS( Network Information Service) **、および他の**RPCベースのサービス**と共に使用され、ネットワークサービスを効果的に管理します。
2020-07-15 15:43:14 +00:00
2024-02-08 22:31:36 +00:00
**デフォルトポート:** 111/TCP/UDP、Oracle Solaris では 32771
2021-10-18 11:21:18 +00:00
```
2020-07-15 15:43:14 +00:00
PORT STATE SERVICE
111/tcp open rpcbind
```
2023-07-07 23:42:27 +00:00
## 列挙
2021-10-18 11:21:18 +00:00
```
2020-07-15 15:43:14 +00:00
rpcinfo irked.htb
nmap -sSUC -p111 192.168.10.1
```
2022-05-08 23:13:03 +00:00
### Shodan
2020-07-15 15:43:14 +00:00
* `port:111 portmap`
2022-05-08 23:13:03 +00:00
## RPCBind + NFS
2020-07-15 15:43:14 +00:00
2024-02-09 09:15:30 +00:00
サービスNFSを見つけた場合、おそらくファイルのリスト表示やダウンロード( おそらくアップロードも) が可能になります:
2020-07-15 15:43:14 +00:00
2021-10-18 11:21:18 +00:00
![](< .. / . gitbook / assets / image ( 232 ) . png > )
2020-07-15 15:43:14 +00:00
2024-02-08 22:31:36 +00:00
[2049 - Pentesting NFS service ](nfs-service-pentesting.md )を読んで、このプロトコルをテストする方法について詳しく学びましょう。
2020-07-15 15:43:14 +00:00
2022-05-08 23:13:03 +00:00
## NIS
2020-07-15 15:43:14 +00:00
2024-02-09 09:15:30 +00:00
**NIS**の脆弱性を探るには、`ypbind` サービスの特定から始める2段階のプロセスが必要です。この探索の中心は**NISドメイン名**の発見であり、これがなければ進捗が停滞します。
2020-07-15 15:43:14 +00:00
2021-10-18 11:21:18 +00:00
![](< .. / . gitbook / assets / image ( 233 ) . png > )
2020-07-15 15:43:14 +00:00
2024-02-09 09:15:30 +00:00
探索の旅は、必要なパッケージをインストールすること(`apt-get install nis` )から始まります。次のステップでは、`ypwhich` を使用してNISサーバーの存在を確認し、ドメイン名とサーバーIPに対してピンクを行い、これらの要素がセキュリティのために匿名化されていることを確認する必要があります。
2020-07-15 15:43:14 +00:00
2024-02-08 22:31:36 +00:00
最後で重要なステップは、`ypcat` コマンドを使用して、特に暗号化されたユーザーパスワードなどの機密データを抽出することです。これらのハッシュは、**John the Ripper**などのツールを使用して解読されると、システムアクセスと特権に関する洞察が明らかになります。
2020-07-15 15:43:14 +00:00
```bash
2024-02-08 22:31:36 +00:00
# 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
2020-07-15 15:43:14 +00:00
```
2024-02-08 22:31:36 +00:00
### 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 | メールエイリアスの詳細 |
2020-07-15 15:43:14 +00:00
2024-01-03 00:54:19 +00:00
## RPC ユーザー
2020-07-15 15:43:14 +00:00
2024-02-09 09:15:30 +00:00
もし、**rusersd** サービスが以下のようにリストされている場合:
2020-07-15 15:43:14 +00:00
2021-10-18 11:21:18 +00:00
![](< .. / . gitbook / assets / image ( 231 ) . png > )
2020-07-15 15:43:14 +00:00
2024-02-08 22:31:36 +00:00
ボックスのユーザーを列挙することができます。詳細は[1026 - Pentesting Rsusersd ](1026-pentesting-rusersd.md )を参照してください。
2020-07-15 15:43:14 +00:00
2024-02-08 22:31:36 +00:00
## フィルタリングされた Portmapper ポートのバイパス
2020-07-15 15:43:14 +00:00
2024-02-09 09:15:30 +00:00
**nmapスキャン**を実行し、ポート111がフィルタリングされているオープンなNFSポートを発見した場合、これらのポートの直接的な攻撃は実行できません。しかし、**ローカルでポートマッパーサービスをシミュレートし、自分のマシンからターゲットへのトンネルを作成**することで、標準ツールを使用して攻撃が可能になります。このテクニックにより、ポート111のフィルタリングされた状態をバイパスし、NFSサービスへのアクセスが可能になります。この方法の詳細なガイダンスについては、[このリンク ](https://medium.com/@sebnemK/how-to-bypass-filtered-portmapper-port-111-27cee52416bc )で提供されている記事を参照してください。
2020-07-15 15:43:14 +00:00
2022-05-08 23:13:03 +00:00
## Shodan
2020-09-22 19:45:05 +00:00
* `Portmap`
2024-02-09 09:15:30 +00:00
## 練習用のラボ
2023-05-29 10:58:05 +00:00
2024-02-08 22:31:36 +00:00
* これらのテクニックを[**Irked HTB マシン** ](https://app.hackthebox.com/machines/Irked )で練習してください。
2021-08-12 09:28:09 -04:00
2024-02-08 22:31:36 +00:00
## HackTricks Automatic Commands
2021-10-18 11:21:18 +00:00
```
2021-08-12 09:28:09 -04:00
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
2021-08-15 13:28:15 -04:00
Entry_1:
2023-07-07 23:42:27 +00:00
Name: Notes
Description: Notes for PortMapper
Note: |
2024-02-08 22:31:36 +00:00
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.
2021-08-15 13:28:15 -04:00
2023-07-07 23:42:27 +00:00
https://book.hacktricks.xyz/pentesting/pentesting-rpcbind
2021-08-15 22:19:51 +00:00
2021-08-15 13:28:15 -04:00
Entry_2:
2023-07-07 23:42:27 +00:00
Name: rpc info
Description: May give netstat-type info
Command: whois -h {IP} -p 43 {Domain_Name} & & echo {Domain_Name} | nc -vn {IP} 43
2021-08-15 13:28:15 -04:00
Entry_3:
2023-07-07 23:42:27 +00:00
Name: nmap
Description: May give netstat-type info
Command: nmap -sSUC -p 111 {IP}
2021-08-12 09:28:09 -04:00
```
2022-04-28 16:01:33 +00:00
< details >
2024-02-09 09:15:30 +00:00
< summary > < strong > AWSハッキングをゼロからヒーローまで学ぶ< / strong > < a href = "https://training.hacktricks.xyz/courses/arte" > < strong > htARTE( HackTricks AWS Red Team Expert) < / strong > < / a > < strong > ! < / strong > < / summary >
2024-01-03 00:54:19 +00:00
2024-02-09 09:15:30 +00:00
HackTricksをサポートする他の方法:
2022-04-28 16:01:33 +00:00
2024-02-08 22:31:36 +00:00
* **HackTricksで企業を宣伝したい**または**HackTricksをPDFでダウンロードしたい**場合は、[**SUBSCRIPTION PLANS** ](https://github.com/sponsors/carlospolop )をチェックしてください!
* [**公式PEASS& HackTricksスワッグ** ](https://peass.creator-spring.com )を入手する
2024-02-09 09:15:30 +00:00
* [**The PEASS Family** ](https://opensea.io/collection/the-peass-family )を発見し、独占的な[**NFTs** ](https://opensea.io/collection/the-peass-family )コレクションを見つける
* **💬 [**Discordグループ** ](https://discord.gg/hRep4RUj7f )または[**telegramグループ** ](https://t.me/peass )に参加するか、**Twitter** 🐦 [**@carlospolopm** ](https://twitter.com/hacktricks_live )で**フォロー**する。
* **ハッキングトリックを共有するために、[**HackTricks** ](https://github.com/carlospolop/hacktricks )と[**HackTricks Cloud** ](https://github.com/carlospolop/hacktricks-cloud )のgithubリポジトリにPRを提出してください。
2022-04-28 16:01:33 +00:00
< / details >