> For the complete documentation index, see [llms.txt](https://w0lf-f4ng.gitbook.io/cheat-sheet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://w0lf-f4ng.gitbook.io/cheat-sheet/pentesting-infraestructura/information-gathering.md).

# Information Gathering

## Información del objetivo

### WHOIS

Protocolo usado para obtener información de todos los dominios registrados.

Este protocolo utiliza el puerto TCP 43.

{% tabs %}
{% tab title="Windows" %}
En Windows es necesario descargar el siguiente [software](https://learn.microsoft.com/es-mx/sysinternals/downloads/whois):

```batch
whois.exe google.com
```

{% endtab %}

{% tab title="Linux" %}
En linux ya se tiene pre-instalado el programa:

```bash
whois google.com
```

{% endtab %}

{% tab title="Web" %}

* [Whois Lookup](https://whois.domaintools.com/)
  {% endtab %}
  {% endtabs %}

## DNS

{% tabs %}
{% tab title="Nslookup" %}
Enumeración de IPs de un dominio:

```bash
nslookup google.com
```

Enumeración reversa de una IP al dominio:

```bash
nslookup -type=PTR 8.8.8.8
```

Enumeración de registros DNS asociados a un dominio:

```bash
nslookup -querytype=ANY google.com
```

Enumeración de servidores NS:

```bash
nslookup -type=NS google.com
```

{% endtab %}
{% endtabs %}

## Enumeración de la infraestructura del sitio

Algunos headers de las respuestas de los sitios pueden brindar información de la infraestructura de este, como el WAF, CMS o la versión del servicio.

{% tabs %}
{% tab title="Web" %}
Sitios:

* [Netcraft](https://searchdns.netcraft.com/)
  {% endtab %}

{% tab title="Wappalyzer" %}
Podemos usar el plugin de navegador o su sitio web:

* [Plugin](https://www.wappalyzer.com/apps/)
* [Sitio web](https://www.wappalyzer.com/lookup/)
  {% endtab %}

{% tab title="Whatweb" %}

* [Whatweb](https://github.com/urbanadventurer/WhatWeb)

```bash
whatweb google.com
whatweb google.com -v
```

{% endtab %}

{% tab title="Netcat" %}
Ejemplos:

* [Black Box testing and example](https://wiki.owasp.org/index.php/Testing_for_Web_Application_Fingerprint_\(OWASP-IG-004\)#Black_Box_testing_and_example)
* [Black Box testing](https://wiki.owasp.org/index.php/Fingerprint_Web_Application_Framework_\(OTG-INFO-008\)#Black_Box_testing)

```bash
nc google.com 80
HEAD / HTTP/1.0
```

{% endtab %}
{% endtabs %}

## Enumeración de subdominios

{% tabs %}
{% tab title="Google Dorks" %}

```
site:google.com -inurl:www
site:google.com -site:www.google.com
```

* Para no incluir un subdominio, podemos usar el operador `-`
  {% endtab %}

{% tab title="DNSEnum" %}

* [DNSEnum](https://github.com/SparrowOchon/dnsenum2)

```bash
dnsenum google.com
dnsenum google.com -f subdomains_wordlist.txt
```

{% endtab %}
{% endtabs %}


---

# 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://w0lf-f4ng.gitbook.io/cheat-sheet/pentesting-infraestructura/information-gathering.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.
