WHOIS in Ethical Hacking: Complete Guide
1. Introduction to WHOIS
WHOIS is a protocol used to query databases that store domain registration information. It provides details such as:
- Domain owner (registrant)
- Registrar (company that registered the domain)
- Creation, expiration, and update dates
- Name servers (DNS)
- Contact information (email, phone, address)
Ethical hackers use WHOIS to:
- Identify ownership of suspicious domains.
- Find attack surfaces (e.g., related domains).
- Gather intelligence for phishing or social engineering.
2. Types of WHOIS Data
A. Domain WHOIS
- Contains details about a registered domain (e.g., com).
- Example Query:
root@insectechs:~/#whois insectechs.in
B. IP WHOIS
- Provides information about IP ranges and their owners (e.g., ISPs, organizations).
- Example Query:
root@insectechs:~/#whois 8.8.8.8
C. Registrar WHOIS
- Shows which company registered the domain (e.g., GoDaddy, Namecheap).
3. How WHOIS Works in Ethical Hacking
A. Footprinting & Reconnaissance
- Identifying Domain Owners:
- Useful for tracking malicious domains.
- Example: Finding the owner of a phishing site.
- Discovering Related Domains:
- Attackers often register similar domains (com vs example.com).
B. Social Engineering Attacks
- WHOIS reveals email addresses, phone numbers, and names.
- Example: Impersonating a domain admin in a phishing email.
C. Network Enumeration
- WHOIS for IP ranges helps map an organization’s infrastructure.
- Example: Finding all IP blocks owned by a company.
4. WHOIS Lookup Methods
A. Command Line (Linux/Windows/Mac)
- Linux/Mac:
root@insectechs:~/#whois insectechs.in
- Windows (requires installation):
Open powershell
Invoke-WebRequest -Uri “https://www.whois.com/whois/example.com” | Select-Object -ExpandProperty Content
B. Online WHOIS Tools
C. Automated WHOIS with Python
python
import whois domain = “example.com”w = whois.whois(domain)print(w)
(Requires python-whois library: pip install python-whois)
5. Analyzing WHOIS Data (Examples)
Example 1: Basic Domain Lookup
root@insectechs:~/#whois google.com
Output Highlights:
Domain Name: GOOGLE.COM Registry Domain ID: 2138514_DOMAIN_COM-VRSN Registrar WHOIS Server: whois.markmonitor.com Registrar: MarkMonitor Inc. Creation Date: 1997-09-15T04:00:00Z Expiration Date: 2028-09-14T04:00:00Z Name Server: ns1.google.com Name Server: ns2.google.com Registrant Email: abusecomplaints@markmonitor.com
Insights:
- Google uses MarkMonitor for domain protection.
- The domain was registered in 1997.
Example 2: Finding IP Owner
root@insectechs:~/#whois 8.8.8.8
Output Highlights:
NetRange: 8.8.8.0 – 8.8.8.255 CIDR: 8.8.8.0/24 NetName: LVLT-GOGL-8-8-8 OrgName: Google LLC OrgId: GOGL Country: US
Insights:
- 8.8.8 is owned by Google (Google Public DNS).
6. WHOIS Privacy & Limitations
A. WHOIS Privacy Protection
- Many registrars offer WHOIS masking (e.g., Namecheap, GoDaddy).
- Instead of real data, you see:
Registrant Name: REDACTED FOR PRIVACY Registrant Email: privacyprotect@registrar.com
B. GDPR Impact on WHOIS
- Due to privacy laws (GDPR), some WHOIS records hide personal data.
- Workarounds:
- Use historical WHOIS (e.g., WHOIS History).
- Check Wayback Machine for old records.
7. WHOIS in Penetration Testing
A. Finding Subdomains & Related Domains
- Use WHOIS to find domains owned by the same organization.
- Example:
root@insectechs:~/#whois microsoft.com | grep “Name Server”
(Shows DNS servers that may host other domains.)
B. Detecting Domain Expiration for Takeover
- Expired domains can be hijacked.
- Example:
root@insectechs:~/#whois olddomain.com | grep “Expiration Date”
C. Email Harvesting for Phishing
- Extract emails from WHOIS for social engineering.
- Example:
root@insectechs:~/#whois target.com | grep “Email”
8. WHOIS Tools & Resources
Command Line Tools
|
Tool |
Description |
|
whois |
Built-in Linux/Windows tool |
|
jwhois |
Advanced WHOIS client |
Online WHOIS Services
https://insectechs.in/network-utilities-ip-tools-who-is-email-malware-domain-tools/
Advanced WHOIS Tools
- Maltego (Graph-based WHOIS analysis)
- Recon-ng (Automated WHOIS lookups)
- SpiderFoot (Aggregates WHOIS with other OSINT)
Check https://insectechs.in/network-utilities-ip-tools-who-is-email-malware-domain-tools/
9. Legal & Ethical Considerations
✅ Allowed:
- Checking WHOIS for authorized penetration testing.
- Researching domains for threat intelligence.
❌ Not Allowed:
- Using WHOIS data for spam or illegal activities.
- Impersonating domain owners without permission.
10. Conclusion
WHOIS is a powerful tool in ethical hacking for:
✔ Footprinting (gathering domain/IP info)
✔ Social engineering (finding contact details)
✔ Network mapping (discovering related assets)
Next Steps:
- Combine WHOIS with DNS enumeration (dig, nslookup).
- Use reverse WHOIS to find all domains owned by an organization.