# Enumerando HTTP

Essa fase é muito importante para sabermos, por exemplo:

→Versões do web server (IIS, Apache, Nginx, etc).

→Tecnologias utilizadas (PHP, ASP, JSP, etc).

→Métodos aceitos (PUT, POST, DELETE, etc).

Como fazer?

→Buscando portas abertas: 80, 8080, 81, 8181 (pode-se ter um servidor web rodando em qualquer porta tcp).

→Saber como um sistema interage com ele quando utilizamos o protocolo HTTP/1.0 e HTTP/1.1 (necessário usar o **Host:**).

→ Fazer requisições GET, HEAD, OPTIONS.

→Utilitários que podemos utilizar: nc, curl, telnet.

```
user@xubuntu:~$ nc -v businesscorp.com.br 80
Connection to businesscorp.com.br 80 port [tcp/http] succeeded!
HEAD / HTTP/1.0

HTTP/1.1 200 OK
Date: Sat, 28 Sep 2019 19:18:17 GMT
Server: Apache/2.2.22 (Debian)
Last-Modified: Wed, 25 Sep 2019 17:05:45 GMT
ETag: "20463-1bb6-59363a9ea0957"
Accept-Ranges: bytes
Content-Length: 7094
Vary: Accept-Encoding
Connection: close
Content-Type: text/html

```

```
user@xubuntu:~$ nc -v businesscorp.com.br 80
Connection to businesscorp.com.br 80 port [tcp/http] succeeded!
OPTIONS /aadasda HTTP/1.0

HTTP/1.1 200 OK
Date: Sat, 28 Sep 2019 19:20:22 GMT
Server: Apache/2.2.22 (Debian)
Allow: GET,HEAD,POST,OPTIONS
Content-Length: 0
Connection: close
```

Quando formos utilizar o HTTP1.1, é necessário informar o header **host**, pois em alguns casos se não for passado, o servidor não irá aceitar. Pode haver um proxy no meio do caminho e o servidor pode ter vários sites hospedados, então para conseguirmos mais informações de uma aplicação em específico, é necessário informar o host junto com o domínio.

```
user@xubuntu:~$ nc -v businesscorp.com.br 80
Connection to businesscorp.com.br 80 port [tcp/http] succeeded!
GET / HTTP/1.1
Host: businesscorp.com.br
```

Quando fazemos uma requisição para a raíz da aplicação, não é retornado no cabeçalho a versão da linguagem utilizada. Para conseguirmos essa informação, é necessário informar o arquivo dessa tecnologia. Sem informar irá retornar a seguinte resposta abaixo.

```
user@xubuntu:~$ nc 172.16.1.60 80
HEAD / HTTP/1.0

HTTP/1.1 200 OK
Content-Length: 689
Content-Type: text/html
Last-Modified: Sat, 07 Feb 2015 19:47:36 GMT
Accept-Ranges: bytes
ETag: "36f259ece43d01:0"
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Sat, 10 Jul 2021 14:56:06 GMT
Connection: close
```

Agora informando o arquivo irá trazer a versão.

```
user@xubuntu:~$ nc 172.16.1.60 80 
HEAD /index.aspx HTTP/1.0

HTTP/1.1 404 Not Found
Cache-Control: private
Content-Length: 1505
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Sat, 10 Jul 2021 14:57:28 GMT
Connection: close

```


---

# 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://nicollaslopes.gitbook.io/estudos/master/enumeration/enumerando-http.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.
