hacktricks/network-services-pentesting/43-pentesting-whois.md

4 KiB
Raw Blame History

43 - Pentesting WHOIS

{% hint style="success" %} Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)

Support HackTricks
{% endhint %}

基本信息

WHOIS 协议作为一种标准方法,通过特定数据库查询各种互联网资源的注册人或持有者。这些资源包括域名、IP地址块和自治系统等。除此之外该协议还可用于访问更广泛的信息。

默认端口: 43

PORT   STATE  SERVICE
43/tcp open   whois?

Enumerate

获取whois服务关于域名的所有信息

whois -h <HOST> -p <PORT> "domain.tld"
echo "domain.ltd" | nc -vn <HOST> <PORT>

注意有时在请求WHOIS服务的某些信息时所使用的数据库会出现在响应中

此外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.xyz/pentesting/pentesting-smtp

Entry_2:
Name: Banner Grab
Description: Grab WHOIS Banner
Command: whois -h {IP} -p 43 {Domain_Name} && echo {Domain_Name} | nc -vn {IP} 43

{% hint style="success" %} 学习与实践 AWS 黑客技术:HackTricks 培训 AWS 红队专家 (ARTE)
学习与实践 GCP 黑客技术:HackTricks 培训 GCP 红队专家 (GRTE)

支持 HackTricks
{% endhint %}