# 43 - Pentesting WHOIS {{#include ../banners/hacktricks-training.md}} ## Informazioni di base Il protocollo **WHOIS** funge da metodo standard per **richiedere informazioni sui registranti o detentori di varie risorse Internet** attraverso specifiche banche dati. Queste risorse comprendono nomi di dominio, blocchi di indirizzi IP e sistemi autonomi, tra gli altri. Oltre a questi, il protocollo trova applicazione nell'accesso a uno spettro più ampio di informazioni. **Porta predefinita:** 43 ``` PORT STATE SERVICE 43/tcp open whois? ``` ## Enumerare Ottieni tutte le informazioni che un servizio whois ha su un dominio: ```bash whois -h -p "domain.tld" echo "domain.ltd" | nc -vn ``` Nota che a volte, quando si richiede alcune informazioni a un servizio WHOIS, il database utilizzato appare nella risposta: ![](<../images/image (301).png>) Inoltre, il servizio WHOIS deve sempre utilizzare un **database** per memorizzare ed estrarre le informazioni. Quindi, una possibile **SQLInjection** potrebbe essere presente quando si **interroga** il database per alcune informazioni fornite dall'utente. Ad esempio, eseguendo: `whois -h 10.10.10.155 -p 43 "a') or 1=1#"` potresti essere in grado di **estrarre tutto** le **informazioni** salvate nel database. ## Shodan - `port:43 whois` ## HackTricks Comandi Automatici ``` 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}}