43 - Pentesting WHOIS
Tip
AWS हैकिंग सीखें और अभ्यास करें:
HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें:HackTricks Training GCP Red Team Expert (GRTE)
Azure हैकिंग सीखें और अभ्यास करें:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks का समर्थन करें
- सदस्यता योजनाओं की जांच करें!
- हमारे 💬 Discord समूह या टेलीग्राम समूह में शामिल हों या हमें Twitter 🐦 @hacktricks_live** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें और HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में PRs सबमिट करें।
मूल जानकारी
The WHOIS प्रोटोकॉल विशिष्ट डेटाबेस के माध्यम से विभिन्न इंटरनेट संसाधनों के पंजीकृतकर्ताओं या धारकों के बारे में पूछताछ करने का एक मानक तरीका है। ये संसाधन domain names, blocks of IP addresses, और autonomous systems सहित अन्य चीज़ों को शामिल करते हैं। इनके अलावा, यह प्रोटोकॉल और भी व्यापक जानकारी तक पहुँचने के लिए प्रयोग किया जाता है।
Default port: 43
PORT STATE SERVICE
43/tcp open whois?
एक आक्रामक दृष्टिकोण से, ध्यान रखें कि WHOIS केवल एक सादा-पाठ TCP सेवा है: क्लाइंट एक क्वेरी भेजता है, सर्वर मानव-पठनीय टेक्स्ट लौटाता है, और कनेक्शन बंद होना प्रतिक्रिया के अंत को चिह्नित करता है। इस प्रोटोकॉल में कोई अंतर्निहित प्रमाणीकरण, अखंडता, या गोपनीयता नहीं है।
आधुनिक वास्तविकता: WHOIS बनाम RDAP
इंटरनेट डोमेन रजिस्ट्रेशन डेटा के लिए, WHOIS अब कई सार्वजनिक gTLD वर्कफ़्लोज़ के लिए अधिकारिक विकल्प नहीं रहा है। ICANN ने gTLD रजिस्ट्रेशन डेटा के लिए WHOIS को 2025-01-28 को sunset कर दिया, जिससे मशीन-रीडेबल डोमेन रजिस्ट्रेशन लुकअप के लिए प्राथमिक प्रोटोकॉल RDAP बन गया।
हालाँकि, TCP/43 का परीक्षण अभी भी उपयोगी है क्योंकि यह निम्न में दिखाई देता रहता है:
- पुरानी या निजी WHOIS सेवाएँ
- RIR / IP आवंटन वर्कफ़्लोज़
- आंतरिक रजिस्ट्रियाँ और कस्टम एसेट डेटाबेस
- तृतीय-पक्ष वेब टूल और पुरानी ऑटोमेशन जो अभी भी WHOIS प्रतिक्रियाओं पर भरोसा करती हैं
यदि आपका उद्देश्य reverse whois, व्यापक एसेट विस्तार, या recursive external recon है, तो यहाँ काम को दोहराने से बचने के लिए the External Recon Methodology page देखें।
सूचीबद्ध करें
डोमेन के बारे में whois सेवा के पास जो भी जानकारी है, सब प्राप्त करें:
whois -h <HOST> -p <PORT> "domain.tld"
printf 'domain.tld\r\n' | nc -vn <HOST> <PORT>
यदि आप किसी public-facing WHOIS service पाते हैं, तो दोनों domain और IP/ASN शैली के queries पर टेस्ट करें, क्योंकि कई implementations ऑब्जेक्ट प्रकार के आधार पर अलग backends या parsers एक्सपोज़ करती हैं:
# Domain
printf 'example.com\r\n' | nc -vn <HOST> 43
# IP / CIDR / ASN examples
printf '8.8.8.8\r\n' | nc -vn <HOST> 43
printf 'AS15169\r\n' | nc -vn <HOST> 43
ध्यान दें कि कभी-कभी WHOIS सेवा से कुछ जानकारी अनुरोध करने पर उपयोग में लाया जा रहा डेटाबेस प्रतिक्रिया में दिखाई दे सकता है:
.png)
Referral Chasing and Better Enumeration
काफी उपयोगी WHOIS enumeration referrals के पीछे छिपी होती है। उदाहरण के लिए, एक सर्वर केवल आपको अगले authoritative WHOIS server की ओर इशारा कर सकता है जो किसी TLD या RIR के लिए जिम्मेदार है। इसे मैन्युअल रूप से परखना लाभदायक है क्योंकि कुछ custom services follow-up queries को गलत तरीके से संभालती हैं, फ़ील्ड्स को असंगत रूप से redact करती हैं, या अतिरिक्त backend metadata को leak कर देती हैं।
उपयोगी विकल्प और हेल्पर्स:
# Ask IANA first and then follow the authoritative referral (common Linux whois clients)
whois -I example.com
whois -I 8.8.8.8
# Let Nmap follow domain/IP WHOIS referrals automatically
nmap --script whois-domain <target>
nmap --script whois-ip <target>
# For IP ranges, disable the WHOIS cache if you care about smaller delegated blocks
nmap --script whois-ip --script-args whois.whodb=nocache <target>
जब सेवा पूरी तरह से redacted न हो तो pivot करने के लिए दिलचस्प फ़ील्ड:
- Registrar / Org / abuse contact phishing रिपोर्टिंग या org-mapping के लिए
- Creation / update / expiration times नई पंजीकृत infrastructure को पहचानने के लिए
- Nameservers एक ही operator द्वारा प्रबंधित डोमेन को क्लस्टर करने के लिए
- Referral server names पुरानी या भुला दी गई WHOIS infrastructure खोजने के लिए
RDAP — संरचित उत्तराधिकारी के रूप में
भले ही प्रदर्शित सेवा पोर्ट 43 पर क्लासिक WHOIS ही क्यों न हो, जाँचें कि क्या वही प्रदाता RDAP भी प्रदान करता है क्योंकि RDAP को पार्स करना अक्सर आसान होता है और automation के लिए बेहतर होता है:
curl -s https://www.rdap.net/domain/example.com | jq
curl -s https://rdap.arin.net/registry/ip/8.8.8.8 | jq
एक व्यावहारिक आक्रामक सूक्ष्मता: 2024 के एक मापन अध्ययन में WHOIS और RDAP की बड़े पैमाने पर तुलना से पता चला कि वे हमेशा आपस में बदले जा सकने योग्य नहीं होते, registrar identifiers, creation dates, और nameservers जैसे फ़ील्ड्स में असंगतियाँ मिलती हैं। यदि आपका recon pipeline उन मानों पर निर्भर करता है, तो निर्णय लेने से पहले दोनों स्रोतों की तुलना करें।
Offensive नोट्स
Custom WHOIS Gateways में Backend Injection
इसके अलावा, WHOIS सेवा हमेशा जानकारी स्टोर और निकालने के लिए एक डेटाबेस का उपयोग करती है। इसलिए, एक संभावित SQLInjection मौजूद हो सकता है जब उपयोगकर्ता द्वारा दी गई किसी जानकारी से डेटाबेस को querying किया जाता है। उदाहरण के लिए: whois -h 10.10.10.155 -p 43 "a') or 1=1#" करते हुए आप डेटाबेस में सेव की गई सारी information extract कर पाने में सक्षम हो सकते हैं।
Testing को केवल SQLi तक सीमित न रखें। internal या niche WHOIS deployments में, query को proxy किया जा सकता है:
- SQL / NoSQL backends
- LDAP directories
- shell wrappers around other lookup tools
- HTTP APIs used by registrar or asset-management portals
इसलिए fuzz करें और payloads आज़माएँ जैसे SQLi, LDAP injection, delimiter abuse, बहुत लंबे strings, और malformed UTF-8 / control characters। प्रोटोकॉल स्वयं सरल है; खतरनाक हिस्सा आमतौर पर parser or backend glue code होता है।
Rogue / Stale WHOIS Servers
2024-2025 के प्रासंगिक attack path में outdated WHOIS trust का दुरुपयोग करना शामिल है। अगर कोई registry या tool अपना WHOIS hostname बदलता है और पुराना डोमेन expire हो जाता है, तो एक attacker पुराने hostname को register कर सकता है और एक rogue WHOIS server चला सकता है।
इससे attacker को response body पर नियंत्रण मिल सकता है जो निम्न द्वारा देखी जाती है:
- पुराने WHOIS clients जिनमें hardcoded server mappings हैं
- वेब applications जो WHOIS output fetch करके यूज़र्स को render करते हैं
- automation जो अभी भी domain validation या ownership workflows के लिए WHOIS का उपयोग करती है
यह इसलिए महत्वपूर्ण है क्योंकि एक rogue WHOIS response एंट्री प्वाइंट बन सकता है:
- stored/reflected XSS in web WHOIS frontends
- parser bugs / command injection / eval bugs in libraries consuming the text response
- systems के लिए bad automation decisions जब वे attacker-controlled WHOIS contact data पर भरोसा कर लेते हैं
जब आप किसी private या legacy WHOIS service को पाते हैं, तो हमेशा जांचें कि लौटाए गए refer: / Whois Server: मान, banners, या TLD mappings expired or attacker-registerable domains की ओर इशारा तो नहीं करते।
Shodan
port:43 whois
HackTricks Automatic Commands
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} && printf '{Domain_Name}\r\n' | nc -vn {IP} 43
Entry_3:
Name: Nmap WHOIS Referrals
Description: Follow WHOIS referrals for domain and IP lookups
Command: nmap --script whois-domain,whois-ip --script-args whois.whodb=nocache {IP}
संदर्भ
- ICANN Update: Launching RDAP; Sunsetting WHOIS
- watchTowr Labs - We Spent $20 To Achieve RCE And Accidentally Became The Admins Of .MOBI
Tip
AWS हैकिंग सीखें और अभ्यास करें:
HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें:HackTricks Training GCP Red Team Expert (GRTE)
Azure हैकिंग सीखें और अभ्यास करें:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks का समर्थन करें
- सदस्यता योजनाओं की जांच करें!
- हमारे 💬 Discord समूह या टेलीग्राम समूह में शामिल हों या हमें Twitter 🐦 @hacktricks_live** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें और HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में PRs सबमिट करें।


