# 43 - Pentesting WHOIS {{#include ../banners/hacktricks-training.md}} ## 基本情報 The **WHOIS** protocol serves as a standard method for **inquiring about the registrants or holders of various Internet resources** through specific databases. These resources encompass domain names, blocks of IP addresses, and autonomous systems, among others. Beyond these, the protocol finds application in accessing a broader spectrum of information. **Default port:** 43 ``` PORT STATE SERVICE 43/tcp open whois? ``` ## 列挙 whoisサービスがドメインについて持っているすべての情報を取得します: ```bash whois -h -p "domain.tld" echo "domain.ltd" | nc -vn ``` 注意として、WHOISサービスに情報をリクエストする際、使用されているデータベースがレスポンスに表示されることがあります。 ![](<../images/image (301).png>) また、WHOISサービスは常に情報を保存し抽出するために**データベース**を使用する必要があります。したがって、ユーザーが提供した情報からデータベースを**クエリ**する際に、**SQLインジェクション**が存在する可能性があります。例えば、`whois -h 10.10.10.155 -p 43 "a') or 1=1#"`を実行することで、データベースに保存されている**すべての**情報を**抽出**できるかもしれません。 ## Shodan - `port:43 whois` ## HackTricks 自動コマンド ``` Protocol_Name: WHOIS #Protocol Abbreviation if there is one. Port_Number: 43 #Comma separated if there is more than one. Protocol_Description: WHOIS #Protocol Abbreviation Spelled out Entry_1: Name: Notes Description: Notes for WHOIS Note: | The WHOIS protocol serves as a standard method for inquiring about the registrants or holders of various Internet resources through specific databases. These resources encompass domain names, blocks of IP addresses, and autonomous systems, among others. Beyond these, the protocol finds application in accessing a broader spectrum of information. https://book.hacktricks.wiki/en/network-services-pentesting/pentesting-smtp/index.html Entry_2: Name: Banner Grab Description: Grab WHOIS Banner Command: whois -h {IP} -p 43 {Domain_Name} && echo {Domain_Name} | nc -vn {IP} 43 ``` {{#include ../banners/hacktricks-training.md}}