Overview
WHOIS is a command-line tool for querying domain registration information from public WHOIS databases. Returns registrant details, registrar info, nameservers, registration dates, and contact information. Useful during passive recon to gather intelligence on a target domain without directly interacting with their infrastructure.
Target / Context
Domain names and IP address ranges. Core passive recon tool — queries public registration databases, not the target directly.
Installation
Installation Commands:
sudo apt install whois
Basic Usage
Basic Usage:
whois www.example.com
man whois
Flags & Options
Flags & Options:
| Flag | Description | Example |
|---|---|---|
-h | Specify WHOIS server to query | whois -h whois.arin.net 10.10.10.1 |
-p | Specify port for WHOIS server | whois -p 43 example.com |
Common Use Cases
Query Domain Registration Info
Commands:
whois example.com
Query an IP Address
Commands:
whois 10.10.10.1
Penetration Testing Use Cases
Phishing Domain Verification:
Use WHOIS to assess whether an email sender’s domain is suspicious:
- Registration date — recently registered domains (days/weeks old) are a red flag
- Privacy service — registrant hidden behind a privacy proxy (common in phishing infrastructure)
- Nameservers — known malicious hosting providers or bulletproof hosters
Check registrar, creation date, and nameservers
whois <suspicious-domain>
C2 Infrastructure Identification:
If malware analysis reveals a C2 domain, WHOIS identifies the hosting provider:
- Retrieve the registrar and abuse contact information
- Report the domain to the hosting provider’s abuse desk
- Identify the IP range used and correlate with known threat infrastructure
Extract hosting provider, ASN, and registrant contact
whois <c2-domain>
Threat Actor Attribution:
Different domains registered by the same actor often share nameservers, registrars, or contact details:
- Pivot from a known malicious domain to related infrastructure via shared nameserver entries
- Historical WHOIS records reveal ownership changes and contact patterns over time
- Useful for building a profile of recurring threat actor infrastructure
Historical WHOIS records: https://whoisfreaks.com/