> 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/writeups-ctf/hackthebox/linux-easy/blocky-hackthebox-writeup.md).

# تقرير HackTheBox عن Blocky

{% embed url="<https://app.hackthebox.com/machines/48>" %}

{% hint style="warning" %}
**المهارات:**

* استكشاف WordPress
* تسرب المعلومات
* تحليل ملف jar - JD-Gui + الوصول عبر SSH
* استغلال صلاحية Sudoers (تصعيد الامتيازات)
  {% endhint %}

## الاستطلاع

**إعداد مساحة العمل:**

قم بإعداد مساحة العمل بإنشاء ثلاثة مجلدات لتخزين المحتوى المهم، والاستغلالات، ونتائج استطلاع Nmap.

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

**فحص اتصال VPN**

تحقق من اتصال VPN لضمان تواصل مستقر مع الجهاز المستهدف.

<figure><img src="/files/7900558cc1f37062a6441c6824578f3eca5b11c1" alt=""><figcaption></figcaption></figure>

**اكتشاف المنافذ المفتوحة باستخدام Nmap:** قم بحصر المنافذ المفتوحة وتصدير النتائج إلى الملف "allPorts" في دليل Nmap:

```bash
nmap -p- --open -sS -n -Pn --min-rate 5000 10.10.10.37 -oG allPorts
```

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

**تحليل المنافذ المفتوحة باستخدام extractport:** استخدام دالة extractport لعرض المنافذ المفتوحة بشكل مُولَّد ونسخها إلى الحافظة. (21.22.80,25565)

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

**فحص إصدار المنفذ باستخدام Nmap:** استخدام Nmap لفحص إصدار المنفذ واستخراج المعلومات إلى الملف "targeted":

```bash
nmap -sCV -p21,22,80,25565 10.10.10.37 -oN targeted
```

<figure><img src="/files/159da75839b1382049bda0a9c5d1ed48da33bd39" alt=""><figcaption></figcaption></figure>

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

### المنفذ 80

<figure><img src="/files/79e0251cc45ce0671b5c19fb5049b383884da556" alt=""><figcaption></figcaption></figure>

**تعداد الأدلة باستخدام Gobuster:**

نستخدم **Gobuster** لتعداد الأدلة على خادم الويب الخاص بالجهاز المستهدف.

```bash
gobuster dir -u http://blocky.htb/ -w /usr/share/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -t 100
```

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

نكتشف دليلاً باسم **plugins**.

<figure><img src="/files/849096a05e2b9f33bac986a8c3ddd4e888860e6c" alt=""><figcaption></figcaption></figure>

**تنزيل واستخراج ملف BlockyCore.jar:**

نقوم بتنزيل ملف **BlockyCore.jar** الذي يبدو كإضافة مخصصة. ثم نستخرج محتوياته.

```java
jar xf BlockyCore.jar
```

#### تفكيك ملف BlockyCore.class

في الملف المستخرج نجد ملف **BlockyCore.class** . نقوم بتفكيكه باستخدام **javap** لفحص محتوياته

```bash
javap -c BlockyCore.class
```

نعثر على مجموعة من بيانات الاعتماد لقاعدة البيانات:

* **localhost**
* **root**
* **8YsqfCTnvxAUeduzjNSXe22**

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

#### الوصول إلى قاعدة البيانات عبر PhpMyAdmin

باستخدام بيانات الاعتماد المستخرجة، نسجل الدخول إلى **PhpMyAdmin** ونكتشف جدولاً في قاعدة البيانات يحتوي على مستخدم باسم **notch**.

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

**الاتصال عبر SSH:**

نستخدم كلمة المرور **`8YsqfCTnvxAUeduzjNSXe22`** للمستخدم **notch** وننجح في تسجيل الدخول.

<figure><img src="/files/88f966e939260e53501a66d1fdd5b8c60b7c5125" alt=""><figcaption></figcaption></figure>

### الراية User.txt

<figure><img src="/files/5dfb8783d0050117585136966053b4d2405d3b04" alt=""><figcaption></figcaption></figure>

## تصعيد الامتيازات

نلاحظ أن المستخدم ينتمي إلى **sudo** المجموعة، مما يتيح لنا استخدام **sudo** لرفع صلاحياتنا

<figure><img src="/files/65d1b371ee35e3332d8863377efba4192baa805e" alt=""><figcaption></figcaption></figure>

**تشغيل الأمر sudo su:**/ ننفذ الأمر التالي للحصول على صدفة root:

```bash
sudo su
8YsqfCTnvxAUeduzjNSXe22
```

### الراية root.txt : )

<figure><img src="/files/2140ba5d1182f1c521d60ccab89e7d999fccb255" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/fc2fe96c67bfb427a4ffdcc5f7e60d5fc87601d9" alt="" width="516"><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/writeups-ctf/hackthebox/linux-easy/blocky-hackthebox-writeup.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.
