# 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: 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:

```
GET https://w0lf-f4ng.gitbook.io/cheat-sheet/pentesting-infraestructura/information-gathering.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
