> 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/ports-and-services/elasticsearch-9200.md).

# Elasticsearch - 9200

Elasticsearch index enumeration, data exposure review, keyword filtering, and base64 credential recovery.

{% hint style="info" %}
Elasticsearch is a real-time search and analytics engine used to quickly index and search large volumes of data. It integrates into the ELK stack to provide advanced data visualization and analysis capabilities.
{% endhint %}

### Elasticsearch - Information Leak

#### Port 9200 hosts Elasticsearch version 6.4.2.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-845fb1672437b01cefd0b2d0d8a5ef12fe5873b5%2Fimage%20(2346).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a6fa307777b94d07df14f3a092c87293f442f19c%2Fimage%20(2342).png?alt=media" alt=""><figcaption></figcaption></figure>

Accessing the `/_cat/indices?` URL returns a list of indices with their UUIDs. To extract the contents of an index, use the following URL:

`http://haystack.htb:9200/<index>/_search?pretty=true&size=1000`

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d67ff3ba6fb8ae20077e89f3264944303a23fe19%2Fimage%20(2350).png?alt=media" alt=""><figcaption></figcaption></figure>

**Data Filtering with Curl**

Using the `quotes` index and filtering on the challenge keyword, relevant information is found:

```bash
curl -s -X GET "http://haystack.htb:9200/quotes/_search?pretty=true&size=1000" | jq | grep -Ei "clave"
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c07fc40eea9a17fe56fb69b73a5f6218e2804a4b%2Fimage%20(2351).png?alt=media" alt=""><figcaption></figcaption></figure>

**Decoding Base64 Encoded Strings**

Two base64-encoded strings are recovered. Decoding them reveals the credentials:

```bash
echo -n "cGFzczogc3BhbmlzaC5pcy5rZXk=" | base64 -d; echo
echo -n "dXNlcjogc2VjdXJpdHkg" | base64 -d; echo
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-cc8b39a983eb79b8bb21141eb943bc402c34642a%2Fimage%20(2347).png?alt=media" alt=""><figcaption></figcaption></figure>

**User:** `security`/ **Password:** `spanish.is.key`


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/ports-and-services/elasticsearch-9200.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
