> For the complete documentation index, see [llms.txt](https://ahmed-tarek.gitbook.io/security-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ahmed-tarek.gitbook.io/security-notes/notes/attack-vectors-by-port/whois.md).

# WHOIS

**`Default Port: 43`**

**WHOIS** is a query and response protocol that is widely used for querying databases to determine the registrant or assignee of Internet resources, such as a domain name, an IP address block, or an autonomous system.

By using the WHOIS protocol, you can gather an extensive amount of information regarding a target.

* Domain owner
* Domain Registrar
* Name Servers
* Creation Date
* Expiration Date
* Last Updated
* State and Country etc.

### Enumeration <a href="#enumeration" id="enumeration"></a>

You can gather a substantial amount of information using the WHOIS protocol.

```
whois hackviser.com
```

Python's python-whois library offers a simple way to communicate with the WHOIS protocol:

```
import whois
w = whois.whois('hackviser.com')
print(w)

print(w.status)
print(w.name)
print(w.org)
print(w.address)
```

### Attack Vectors <a href="#attack-vectors" id="attack-vectors"></a>

Even though WHOIS itself doesn't have any direct vulnerabilities, It can inadvertently lead to security breach by leaking sensitive information.

#### Information Leakage <a href="#information-leakage" id="information-leakage"></a>

Basic reconnaissance and data gathering might allow an attacker to obtain sensitive information like contact information, addresses, registered domains, and many more.

```
whois example.com
```

#### Domain Expiration <a href="#domain-expiration" id="domain-expiration"></a>

An attacker could deny the service by waiting for the domain to expire and then registering the domain for themselves.

```
whois example.com | grep "Expiry Date"
```

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ahmed-tarek.gitbook.io/security-notes/notes/attack-vectors-by-port/whois.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
