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

# Elasticsearch - 9200

Elasticsearch 索引枚举、数据泄露审查、关键词过滤和 base64 凭据恢复。

{% hint style="info" %}
Elasticsearch 是一款实时搜索和分析引擎，用于快速索引和搜索海量数据。它集成到 ELK 技术栈中，提供高级的数据可视化和分析能力。
{% endhint %}

### Elasticsearch - 信息泄露

#### 9200 端口上运行着 Elasticsearch 6.4.2 版本。

<figure><img src="https://1574813340-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://1574813340-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>

访问该 `/_cat/indices?` URL 会返回包含各自 UUID 的索引列表。要提取某个索引的内容，请使用以下 URL：

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

<figure><img src="https://1574813340-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>

**使用 Curl 进行数据过滤**

使用 `quotes` 对索引进行过滤并搜索挑战关键词后，可以找到相关信息：

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

<figure><img src="https://1574813340-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>

**解码 Base64 编码字符串**

恢复出两个 base64 编码的字符串。解码后会显示凭据：

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

<figure><img src="https://1574813340-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>

**用户：** `security`/ **密码：** `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/zh/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.
